Saving a bitmap from a DC ...
I used BitBlt to copy a bitmap from one DC to a nother, Now how can i save the bitmap from the new DC to a .bmb file???
I don''t think the Win API gives a function to do that - but it can be done manually.
Create a new file (in binary mode). Fill out a BITMAPFILEHEADER, and write it to the file. Do the same for a BITMAPINFOHEADER. For an 8-bit bitmap, you''ll need to write the palette as well, but that''s probably not the case. Then make a call to GetDIBits and write the pixel data to the file.
I know this is a bit vague, but I haven''t done it myself. Good luck!
Create a new file (in binary mode). Fill out a BITMAPFILEHEADER, and write it to the file. Do the same for a BITMAPINFOHEADER. For an 8-bit bitmap, you''ll need to write the palette as well, but that''s probably not the case. Then make a call to GetDIBits and write the pixel data to the file.
I know this is a bit vague, but I haven''t done it myself. Good luck!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement