Solved

About adding a bitmap on button

Posted on 2002-06-14
4
150 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 66
twoTwo  challenge 35 108
Problem to event 3 104
Way to decrease size of apk file 9 88
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 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