Saving a bitmap from a DC ...

Started by
1 comment, last by Fma 22 years, 4 months ago
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???
Advertisement
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!
Thanx.

This topic is closed to new replies.

Advertisement