Solved

About adding a bitmap on button

Posted on 2002-06-14
4
146 Views
Last Modified: 2013-11-20
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
Comment
Question by:JonMac
4 Comments
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 50 total points
ID: 7077846
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
 
LVL 16

Expert Comment

by:AlexNek
ID: 7078194
0
 

Expert Comment

by:Yogini_Sahajpal
ID: 7107277
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
 

Expert Comment

by:SpideyMod
ID: 8145205
Administrative Action - Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now