使用new Bitmap(imagePath)读取图片,图片被占用

  • Post author:
  • Post category:其他


BitmapImage bitmap = new BitmapImage();

bitmap.BeginInit();

bitmap.CreateOptions = BitmapCreateOptions.IgnoreImageCache;

bitmap.CacheOption = BitmapCacheOption.OnLoad;

bitmap.UriSource = new Uri(testImage, UriKind.RelativeOrAbsolute);

bitmap.EndInit();

转载于:https://www.cnblogs.com/canyeweiwei/p/11134428.html