JonMac
asked on
About adding a bitmap on button
hi friends
how to add a bitmap on a owner drawn button(which is added on a view) & also on a button which is added on a dialog though controls..
JonMac
how to add a bitmap on a owner drawn button(which is added on a view) & also on a button which is added on a dialog though controls..
JonMac
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hi,
may be this code is useful to u....
CDC *dc=( myButton.GetDC() );
CBitmap bmp, *poldbmp;
CDC memdc;
bmp.LoadBitmap( IDB_BITMAP1);
memdc.CreateCompatibleDC( dc );
poldbmp = memdc.SelectObject( &bmp );
CRect r;
myButton.GetClientRect(&r) ;
dc->BitBlt( r.top, r.left, r.Width(),
r.Heigh(), &memdc, 0, 0, SRCCOPY );
memdc.SelectObject( poldbmp );
may be this code is useful to u....
CDC *dc=( myButton.GetDC() );
CBitmap bmp, *poldbmp;
CDC memdc;
bmp.LoadBitmap( IDB_BITMAP1);
memdc.CreateCompatibleDC( dc );
poldbmp = memdc.SelectObject( &bmp );
CRect r;
myButton.GetClientRect(&r)
dc->BitBlt( r.top, r.left, r.Width(),
r.Heigh(), &memdc, 0, 0, SRCCOPY );
memdc.SelectObject( poldbmp );
Administrative Action - Force Accepted
SpideyMod
Community Support Moderator @Experts Exchange
SpideyMod
Community Support Moderator @Experts Exchange
Look it, please:
http://www.codeguru.com/buttonctrl/bitmap_text_button.shtml