【问题标题】:Convert WriteableBitmap pixel format to Bgra32 in c# wpf在 c# wpf 中将 WriteableBitmap 像素格式转换为 Bgra32
【发布时间】:2011-05-11 06:45:06
【问题描述】:

我有一个 WriteableBitmap,它从文件(主要是 bmp)加载位图图像。我使用的位图文件具有不同的像素格式,例如 Indexed8、Bgra32 等。问题是我的代码仅适用于 bgra32 像素格式。所以我需要帮助在 c# wpf 中将位图转换为 Bgra32 像素格式。

谢谢

【问题讨论】:

    标签: c# wpf image-processing


    【解决方案1】:

    我找到了解决办法:

     if (bmpSource.Format != PixelFormats.Bgra32)
         bmpSource = new FormatConvertedBitmap(bmpSource, PixelFormats.Bgra32, null, 0);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-06-22
      • 1970-01-01
      • 1970-01-01
      • 2018-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多