|
-
March 29th, 1999, 11:06 AM
#1
Urgent: I need help with text on bitmaps
I need to take a CBitmap, write text on it,
and then get it back into a CBitmap, what
is the best way to do this? Right now I'm
doing:
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
//and then I create a CDC object:
CDC dcObj;
dcObj.CreateCompatibleDC(NULL);
dcObj.SelectObject(bitmap);
dcObj.TextOut(0,0, "Hi" ;
// now how exactly do I get it back out?
// I tried this:
CBitmap bitmap2;
bitmap2.CreateCompatibleBitmap(&dcObj, 10, 10);
// and all I get is a black background with
// a grey square in the middle which I think is 10x10
I also tried using the CDC.SelectObject to try to
get the bitmap out and I used GetCurrentBitmap, both
gave me back a grey bitmap. So could someone please
tell me how to do this, or maybe show me where I am
going wrong in my code? Oh and I am pretty new to
C++ and MFC so please speak slowly and with a lot of
big hand movements 
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|