why are you calling g.Dispose() inside the using
c++ScreenshotImage.Source = null;BitmapImage bitmapImage = new BitmapImage();bitmapImage.BeginInit();bitmapImage.CacheOption = BitmapCacheOption.OnLoad;bitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache; bitmapImage.UriSource = new Uri(imagePath);bitmapImage.EndInit();ScreenshotImage.Source = bitmapImage;