What's the easiest way to get the contents of a window (a static control, to be exact) into a bitmap file?
Hi Bieb,
Get the windows dc for the static:
GetClientRect of Static and use measurements to create a Compatible (monochrome) bitmap.
Use GetClientRect of Static and use measurements to create a Compatible DC
Select the bitmap into it.
BitBlt the static into the Comaptible dc.
Call your BMP file creation process.
Peter.
What I mean is, how do you create the bitmap file? Is there an API function to do it?
I'm not sure there is. (Unless you look into the COM stuff - IPicture?)
But it's pretty simple to just write your own directly to file.
- Write header (standard, with a few options for bmp size and number of colours, etc)
- Write palette (silly ordering, but simple enough)
- Write contents (they're stored upside-down :eek)
Well then, I guess I'll look up the format and then write my own library for it. Thanks for the help.
Hi, Bieb
This DoubleSnapFromPoint.zip contains source,
hope it'll help you
[attachment deleted by admin]