?
Solved

About adding a bitmap on button

Posted on 2002-06-14
4
Medium Priority
?
155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 200 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

752 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