2010-06-04 51 views

回答

4

使用FormatConvertedBitmap轉換爲每像素24位編碼之前:

var noAlphaSource = new FormatConvertedBitmap 
{ 
    Source = myBitmapSource, 
    DestinationFormat = PixelFormats.Rgb24 
}; 

var encoder = new PngBitmapEncoder(); 
enc.Frames.Add(noAlphaSource); 
enc.Save(fs); 
1

24bpp位圖沒有alpha通道。由PNG編碼器支持。用PixelFormats.Rgb24創建一個WriteableBitmap。

+0

我沒有在我收到的BitmapSource控制,我怎麼能轉換我收到一個與PixelFormats.Rgb24了的BitmapSource? – Kyle 2010-06-04 19:50:41

相關問題