each scan line(width)-bytes size should be multiple of 4, so 7x7 bitmap is stored as 8x7 ( 8 = 4*2) --> there is "00" at each end of line(eol) 9x7 bitmap as 12x7 ( 8=4*2 <9 < 12=4*3) --> there are "00 00 00" at each eol base on this fact, in the original program, sizing & reading method can be compacted. I hope it will be help for you
Replyplease help me step by step to read, load and draw a bitmap image on a MDI MFC document, explain each step. thank you very much!
ReplyOriginally posted by: yamen
reading from the scanner to my application??
i'm working on an image pro... appliction but i need to load the image directly to my application,now i'm loading the image from a file on my hard disk
Originally posted by: Arie
Sample RGB colrs are quad bytes 00 RR GG BB
the 00 RR will swap so they are RR 00 (named the 2 bytes it WORD1)
BB GG RR 00
I hope it will make sense
About the RGB stored in the file : its in intel format (read about Big & small indian format)
the number are stored in memory as LO-HI value
the GG BB will swap so they are BB GG (named the 2 bytes it WORD2)
and because it a int value then the word RR 00 & BB GG are awapes as HI LO
waht we got is WORD1 WORD2 now we need to perform a swap between them so we wll get WORD2 WORD1 and now if we display the context of WORD1 and WORD 2 we get
and it will explain why it saved like that U can read the four bytes in each pixel and and the value with 0x00FFFFFF and U will get the correct color value (rememeber that the step will be 3 bytes step because the pixel color is saved in 3 bytes for each pixel)
Originally posted by: kosc
I can't fing utilite to scan memory for bitmaps (of activ process) so I'll try to make my own.
Q: Are textures & other stuff stored in memory in bitmap format ?
Originally posted by: Abu
Any one please help me.
I want to read a bmp and convert it to grey scale.
And then want to access the pixels grey value for processing.
Any codesegment or project like this will be great help for me.
Abu
Originally posted by: Deepak M, Natarajan
What is the mainpulation to convert r,g,b values to WORD type
ReplyOriginally posted by: Justin
Wow this is really the best website in describing details of bitmap files that I have encountered so far!! and the comments added by you guys did save me a hell lot of trouble in the debugging process..
Cheers!!
ReplyOriginally posted by: Marc
I am just developing a computer game resource file format. Your article just played in my hands.
thank you
Marc
Originally posted by: Marc
Hi,
i just tried out to read the bitmap file header and got some strange values out when I read the BitmapInfo afterwards. Then i found out that the sizeof operator got 16 bytes for my BitmapFile Header although its just 14 big. I think this has to do how the compiler alignes the code and structures in memory. Wouldn't it be safer to hardcode the size 14 into the fread operation ?