值不在预期的范围内。ArgumentException   在 System.Windows.Media.ColorContext.GetColorContextsHelper(GetColorContextsDelegate getColorContexts)
   在 System.Windows.Media.Imaging.BitmapFrameDecode.get_ColorContexts()
   在 System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
   在 System.Windows.Media.Imaging.BitmapImage.EndInit()

查看最上层错误为System.Windows.Media.ColorContext.GetColorContextsHelper 猜想可能是因为图像文件元数据已损坏 或者该操作系统无法给予解析(测试的时候我自己的win10 可以正常解析 到了win7上就会报该错误)

处理方法:

BitmapImage 的 CreateOptions="IgnoreColorProfile" 忽略颜色配置文件

 

相关文章:

  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2021-10-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-06-10
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案