-
CBitmap
Please tell me I'm too dumb to find it in the MSDN. Maybe a cold and programming don't mix. I just don't get it...
Using VC6 SP5 MFC, I have a CBitmap object constructed from a file. I need a copy of said object to modify it without touching the original. So how hard can it be to create a copy of an object ?
Copy constructor ? Nope.
Assignment operator ? Nope.
Initialization method taking anything I could cast a CBitmap into ? Nope.
WTF ?
-
that's mfc for you, that and no DIB class wrapper.
Here's a <i>suggestion</i> (sorry API):
use 'LoadImage' to return an HBITMAP (ensure LR_SHARED flag is set in last param of LoadImage).
Use 'CopyImage' to get a copy of the image.
Use 'DeleteObject' on original HBITMAP.
Use 'FromHandle ' member fn of CBitmap to return CBitmap obj.
The returned CBitmap object should contain a copy of the file bitmap.
Does that help?
-
I'll give it a try, sounds better than anything I could find ;)
Thanks.