I am trying to convert the bitmap image to byte array in C#. But as per the bitmap format first 12 bytes will be given to bitmap header.
// Converting the bitmap image data to byte array
byte[] bitmapFileData = System.IO.File.ReadAllBytes(bitmapImageFilePath);
i debug this code, but it for my given monochorme bitmap image, the frist 56 bytes filled with some other data and from then its starting with (0, 0, 0, 255, 255,255,255,255......). Since its monochrome bitmap image the byte array contains the RGB of only (0,0,0,255 and 255,255,255,255).
Here my question is, how to filter the bitmap header from the byte array so that i can use the rest of the array as bitmap data. I know that offset value of bitmap format will explain. So which element of byte array gives the offset value?
Please excuse if its a basic question or discussed across different forums. I am new to the imaging part and did lot of googling, but not able to get the perfect understanding.
Can you please provide me the needed information.
Intention: 1. To convert the bitmap image to binary data 2. Get more understanding on image format stuff
Where i use: 1. To print the given bitmap image in one of the printers which will take the hexadecimal string or binary data of the image.