Save a 4bpp Bitmap
-
hi all i try to save a 4bpp bitmap in an memorystream. example: // Clone the original 4bpp bitmap Bitmap bmp = (Bitmap)image.Clone(); using(MemoryStream ms = new MemoryStream()) { bmp.Save(ms, ImageFormat.Bmp); } bmp.Dispose(); this code give me the following error: Error in GDI+ this code works fine but it convert the bitmap to a 32bpp format: using(Bitmap bmp = new Bitmap(image)) { using(MemoryStream ms = new MemoryStream()) { bmp.Save(ms, ImageFormat.Bmp); } } it is possible to save a 4bpp bitmap to a stream? regards JoeSharp
-
hi all i try to save a 4bpp bitmap in an memorystream. example: // Clone the original 4bpp bitmap Bitmap bmp = (Bitmap)image.Clone(); using(MemoryStream ms = new MemoryStream()) { bmp.Save(ms, ImageFormat.Bmp); } bmp.Dispose(); this code give me the following error: Error in GDI+ this code works fine but it convert the bitmap to a 32bpp format: using(Bitmap bmp = new Bitmap(image)) { using(MemoryStream ms = new MemoryStream()) { bmp.Save(ms, ImageFormat.Bmp); } } it is possible to save a 4bpp bitmap to a stream? regards JoeSharp
I havent tried this, but from earlier posts on these message boards, I have got the impression Save only works for pixels that take 8 or more bits, not for 1 or 4 bits per pixel. And that is a pitty. :)
Luc Pattyn