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
JonMacAsked:
Who is Participating?
 
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.

All Courses

From novice to tech pro — start learning today.