2010-06-04 14 views

risposta

4

Usa FormatConvertedBitmap per convertire a 24 bit per pixel prima della codifica è:

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

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

Una bitmap a 24 bpp non ha un canale alfa. Supportato dal codificatore PNG. Crea un WriteableBitmap con PixelFormats.Rgb24.

+0

Non ho il controllo sulla BitmapSource ricevo, come posso convertire il BitmapSource che ricevo a uno con PixelFormats.Rgb24? – Kyle

Problemi correlati