size of memorystream.toarray()
-
Bitmap BMP = new Bitmap(60, 32); Graphics g; g = Graphics.FromImage(BMP); g.DrawString("abcdef", font, Brushes.Red, new PointF()); MemoryStream mem = new MemoryStream(); BMP.Save(mem,ImageFormat.Bmp); Byte[] B = mem.ToArray(); size of B should be 60*32/8 but i got the size is 7734 can i get exact size pls
-
Bitmap BMP = new Bitmap(60, 32); Graphics g; g = Graphics.FromImage(BMP); g.DrawString("abcdef", font, Brushes.Red, new PointF()); MemoryStream mem = new MemoryStream(); BMP.Save(mem,ImageFormat.Bmp); Byte[] B = mem.ToArray(); size of B should be 60*32/8 but i got the size is 7734 can i get exact size pls
JABIR E wrote:
size of B should be 60*32/8
No, it shouldn't. It should be 54+60*4*32, which it is. Each pixel uses four bytes, not a single bit. The bmp file format is not a raw data file, it is an image file format that has a header (in this case 54 bytes), followed by the image data.
--- single minded; short sighted; long gone;