【发布时间】:2011-05-11 06:45:06
【问题描述】:
我有一个 WriteableBitmap,它从文件(主要是 bmp)加载位图图像。我使用的位图文件具有不同的像素格式,例如 Indexed8、Bgra32 等。问题是我的代码仅适用于 bgra32 像素格式。所以我需要帮助在 c# wpf 中将位图转换为 Bgra32 像素格式。
谢谢
【问题讨论】:
标签: c# wpf image-processing
我有一个 WriteableBitmap,它从文件(主要是 bmp)加载位图图像。我使用的位图文件具有不同的像素格式,例如 Indexed8、Bgra32 等。问题是我的代码仅适用于 bgra32 像素格式。所以我需要帮助在 c# wpf 中将位图转换为 Bgra32 像素格式。
谢谢
【问题讨论】:
标签: c# wpf image-processing
我找到了解决办法:
if (bmpSource.Format != PixelFormats.Bgra32)
bmpSource = new FormatConvertedBitmap(bmpSource, PixelFormats.Bgra32, null, 0);
【讨论】: