Saving a bitmap to a Memorystream produces an inverted colors image
Posted
by Raphael
on Stack Overflow
See other posts from Stack Overflow
or by Raphael
Published on 2010-06-13T03:59:30Z
Indexed on
2010/06/13
4:02 UTC
Read the original article
Hit count: 304
I've created an image with GDI+ on my application and now I must convert this image to an array of bytes.
My first thought was this simple code:
public byte[] ToByte()
{
MemoryStream ms = new MemoryStream();
bitmap.Save(ms, ImageFormat.Bmp);
return ms.GetBuffer();
}
The problem with this approach is that when I finally save this image into a file the colors are inverted. What I'm I doing wrong?
© Stack Overflow or respective owner