Questions about the BITMAP structure.
-
1. What do i have to set the bmWidthBytes property to? MSDN says to set it to the number of bytes in each scan line, what is a scan line? 2. What do i have to set the bmPlanes property to? MSDN says "Specifies the count of color planes." what are color planes? 3. To create a valid bitmap picture, do i just save the entire BITMAP sctruct to the harddrive or is there another function that i should use? Thanks in advance.
-
1. What do i have to set the bmWidthBytes property to? MSDN says to set it to the number of bytes in each scan line, what is a scan line? 2. What do i have to set the bmPlanes property to? MSDN says "Specifies the count of color planes." what are color planes? 3. To create a valid bitmap picture, do i just save the entire BITMAP sctruct to the harddrive or is there another function that i should use? Thanks in advance.
a scan line corresponds to the width of the screen, bmWidthBytes is the number of bytes required to represent on horizontal line of pixels. the bmPlanes property refers to the number of color planes used by the device. Some printers require that the information for a scan line be sent one color at a time. e.g. send the red value of all the pixels, then send the blue values then the greens. In most cases set it to 1.
-
a scan line corresponds to the width of the screen, bmWidthBytes is the number of bytes required to represent on horizontal line of pixels. the bmPlanes property refers to the number of color planes used by the device. Some printers require that the information for a scan line be sent one color at a time. e.g. send the red value of all the pixels, then send the blue values then the greens. In most cases set it to 1.
-
Thankyou. How do i then create a valid bitmap picture that can be opened in any picture viewer? Do i just use WriteFile? If so, how do i use it? What should i pass as the parameter that should be written and how many bytes shoul di write? Thanks
If you have a BITMAPINFO structure, then you can write it out to disk, using IOStreams or Microsoft specific methods. GDI+ will do this for you, for bmp/jpg/gif/I forget the others. Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002 Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002