Click here to Skip to main content
16,020,811 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: CreateFile() error Pin
David Crow24-Nov-08 17:38
David Crow24-Nov-08 17:38 
AnswerRe: CreateFile() error Pin
iNoble25-Nov-08 2:46
iNoble25-Nov-08 2:46 
QuestionMs embedded vc on pocket pc Pin
mousemicky24-Nov-08 7:38
mousemicky24-Nov-08 7:38 
AnswerRe: Ms embedded vc on pocket pc Pin
CPallini24-Nov-08 7:52
mveCPallini24-Nov-08 7:52 
QuestionUsing GDI+ to display static pictures in MFC dialogs with an alpha channel Pin
Sternocera24-Nov-08 6:34
Sternocera24-Nov-08 6:34 
QuestionRe: Using GDI+ to display static pictures in MFC dialogs with an alpha channel Pin
Mark Salsbery24-Nov-08 7:41
Mark Salsbery24-Nov-08 7:41 
AnswerRe: Using GDI+ to display static pictures in MFC dialogs with an alpha channel Pin
Sternocera24-Nov-08 7:43
Sternocera24-Nov-08 7:43 
GeneralRe: Using GDI+ to display static pictures in MFC dialogs with an alpha channel Pin
Mark Salsbery24-Nov-08 8:05
Mark Salsbery24-Nov-08 8:05 
If you create the bitmaps with a transparent background and save them
in a format that preserves alpha channel info (e.g. PNG) then you can use
GDI+ to easily render the images on any background.

// Note:  the GdiplusStartup/GdiplusShutdown code only needs to be done once per process
//        not wrapped around every set of GDI+ calls

    ULONG dwToken;
    Gdiplus::GdiplusStartupInput input;
    Gdiplus::GdiplusStartupOutput output;
    Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
    if(status == Gdiplus::Ok)
    {
        Gdiplus::Bitmap *srcBitmap = new Gdiplus::Bitmap(L"c:\\some.png", FALSE);
        Gdiplus::Graphics g(hwnd, 0);
        g.DrawImage(srcBitmap, 0, 0);
        delete srcBitmap;

        Gdiplus::GdiplusShutdown(dwToken);
    }

You could also use GDI+ to compose a bitmap programatically.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Using GDI+ to display static pictures in MFC dialogs with an alpha channel Pin
Sternocera24-Nov-08 8:28
Sternocera24-Nov-08 8:28 
GeneralRe: Using GDI+ to display static pictures in MFC dialogs with an alpha channel Pin
Mark Salsbery24-Nov-08 10:15
Mark Salsbery24-Nov-08 10:15 
GeneralRe: Using GDI+ to display static pictures in MFC dialogs with an alpha channel Pin
Sternocera24-Nov-08 10:17
Sternocera24-Nov-08 10:17 
QuestionForcing a non const member function to call a const version of a function Pin
Roger Allen24-Nov-08 6:22
Roger Allen24-Nov-08 6:22 
AnswerRe: Forcing a non const member function to call a const version of a function Pin
bob1697224-Nov-08 6:37
bob1697224-Nov-08 6:37 
QuestionHow to convert wav file to double array? Pin
Carminio24-Nov-08 5:56
Carminio24-Nov-08 5:56 
AnswerRe: How to convert wav file to double array? Pin
Mark Salsbery24-Nov-08 6:32
Mark Salsbery24-Nov-08 6:32 
AnswerRe: How to convert wav file to double array? Pin
Maximilien24-Nov-08 6:39
Maximilien24-Nov-08 6:39 
QuestionRDW_INTERNALPAINT Pin
bob1697224-Nov-08 5:47
bob1697224-Nov-08 5:47 
Questionsome guidence needed Pin
teejayem24-Nov-08 4:02
teejayem24-Nov-08 4:02 
AnswerRe: some guidence needed Pin
Roger Stoltz24-Nov-08 4:17
Roger Stoltz24-Nov-08 4:17 
GeneralRe: some guidence needed Pin
teejayem24-Nov-08 4:36
teejayem24-Nov-08 4:36 
GeneralRe: some guidence needed Pin
Maximilien24-Nov-08 4:51
Maximilien24-Nov-08 4:51 
GeneralRe: some guidence needed Pin
teejayem24-Nov-08 5:22
teejayem24-Nov-08 5:22 
AnswerRe: some guidence needed Pin
Roger Stoltz24-Nov-08 4:56
Roger Stoltz24-Nov-08 4:56 
GeneralRe: some guidence needed Pin
Code-o-mat24-Nov-08 5:08
Code-o-mat24-Nov-08 5:08 
GeneralRe: some guidence needed Pin
teejayem24-Nov-08 5:29
teejayem24-Nov-08 5:29 

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.