From: Christian Henning (chhenning_at_[hidden])
Date: 2006-10-13 12:31:33
This might be a little off-topic.
I'm sure there are several ways. My way is to obtain the pointer to
the pixels, like this:
int nBytes = ::GetObject( hBitmap
, sizeof( DIBSECTION )
, &sDibSection );
The DIBSECTION structure will host a BITMAPINFOHEADER and the mentioned pointer.
Then you can use memcpy to fill up a GIL image. For indexed images you
need to obtain the color table, also. Let me know if you are
interested in the GDI code.
Another way might be using GDI+ . This lib is easier to use than good ol' GDI.
If you have problems contact me. I can help you. I have been wading
through all the pains the GDI offers.
On 10/13/06, Gordon Smith <schmoo2k_at_[hidden]> wrote:
> (This is using windows OS)
> Is there anyway to simply initialize an image (any_image?) )from a memory
> bitmap? I would like to plug it into an existing app to play with it and
> this would really make it simple...
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk