• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

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
0
JonMac
Asked:
JonMac
1 Solution
 
Roshan DavisCommented:
Create an object of CImageList, add the bitmap into it.
You can draw the bitmap to a DC by using its "Draw" Function.

GOOD LUCK
0
 
AlexNekCommented:
0
 
Yogini_SahajpalCommented:
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 );
0
 
SpideyModCommented:
Administrative Action - Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now