Click here to Skip to main content
15,888,521 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: ANTIALIASES_QUALITY for LOGFONT Pin
toxcct5-Feb-09 0:30
toxcct5-Feb-09 0:30 
QuestionHow to identify which toolbar button has been clicked. Pin
TClarke5-Feb-09 0:00
TClarke5-Feb-09 0:00 
QuestionANTIALIASED_QUALITY Pin
_T("No name")4-Feb-09 23:41
_T("No name")4-Feb-09 23:41 
QuestionPNG image in Dialog box Pin
ganesh.dp4-Feb-09 23:35
ganesh.dp4-Feb-09 23:35 
AnswerRe: PNG image in Dialog box Pin
Code-o-mat5-Feb-09 0:09
Code-o-mat5-Feb-09 0:09 
GeneralRe: PNG image in Dialog box Pin
ganesh.dp5-Feb-09 0:56
ganesh.dp5-Feb-09 0:56 
GeneralRe: PNG image in Dialog box Pin
Code-o-mat5-Feb-09 1:11
Code-o-mat5-Feb-09 1:11 
AnswerRe: PNG image in Dialog box Pin
Stuart Dootson5-Feb-09 0:34
professionalStuart Dootson5-Feb-09 0:34 
  1. Create a 'picture control' to hold the picture
  2. Derive a class from CStatic that'll draw the picture. It should declare a message map and handle WM_PAINT and use a CImage to hold the image. Note the call to TransparentBlt, which (as I've coded it) assumes that the top-;peft pixel of hte image is the transparent colour:
    class MyPic : public CStatic
    {
    public:
       MyPic();
    protected:
       afx_msg void OnPaint();
       DECLARE_MESSAGE_MAP()
    private:
       CImage image_;
    };
    MyPic::MyPic()
    {
       image_.Load(png filename);
    }
    void MyPic::OnPaint()
    {
       PAINTSTRUCT ps;
       CDC * drawDC = BeginPaint(&ps);
       CRect rcClient;
       GetClientRect(&rcClient);
       image_.TransparentBlt(*drawDC, rcClient, CRect(0, 0, image_.GetWidth(), image_.GetHeight()), image_.GetPixel(0, 0));
       EndPaint(&ps);
    }
  3. Declare a member variable wfor the picture control that is of the type you've just made.
  4. See your picture be displayed!

GeneralRe: PNG image in Dialog box Pin
ganesh.dp5-Feb-09 0:54
ganesh.dp5-Feb-09 0:54 
GeneralRe: PNG image in Dialog box Pin
Stuart Dootson5-Feb-09 0:58
professionalStuart Dootson5-Feb-09 0:58 
GeneralRe: PNG image in Dialog box Pin
ganesh.dp5-Feb-09 1:03
ganesh.dp5-Feb-09 1:03 
GeneralRe: PNG image in Dialog box Pin
Stuart Dootson5-Feb-09 1:13
professionalStuart Dootson5-Feb-09 1:13 
QuestionCToolBars Pin
Caslen4-Feb-09 23:12
Caslen4-Feb-09 23:12 
QuestionRe: Need help on how redraw bitmap image when clicked on vertical scroll bar Pin
John5024-Feb-09 23:02
John5024-Feb-09 23:02 
QuestionDatabase error "Record is too large." Pin
Le@rner4-Feb-09 22:41
Le@rner4-Feb-09 22:41 
JokeRe: Database error "Record is too large." Pin
CPallini4-Feb-09 23:13
mveCPallini4-Feb-09 23:13 
GeneralRe: Database error "Record is too large." Pin
Le@rner4-Feb-09 23:16
Le@rner4-Feb-09 23:16 
GeneralRe: Database error "Record is too large." Pin
CPallini4-Feb-09 23:19
mveCPallini4-Feb-09 23:19 
JokeRe: Database error "Record is too large." Pin
Caslen4-Feb-09 23:16
Caslen4-Feb-09 23:16 
GeneralRe: Database error "Record is too large." Pin
CPallini4-Feb-09 23:20
mveCPallini4-Feb-09 23:20 
GeneralRe: Database error "Record is too large." Pin
Caslen4-Feb-09 23:21
Caslen4-Feb-09 23:21 
GeneralRe: Database error "Record is too large." Pin
Le@rner4-Feb-09 23:20
Le@rner4-Feb-09 23:20 
QuestionRe: Database error "Record is too large." Pin
David Crow5-Feb-09 3:28
David Crow5-Feb-09 3:28 
QuestionWork with CWebBrowser On Windows Mobile [modified] Pin
Miss_F4-Feb-09 22:36
Miss_F4-Feb-09 22:36 
AnswerRe: Work with CWebBrowser On Windows Mobile Pin
Alain Rist5-Feb-09 4:40
Alain Rist5-Feb-09 4:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.