Fromethius 0 Newbie Poster

Hello everyone and thank you for taking the time to read my post

I am running Visual C++ 2005 and I'm having some trouble with GDI+.


I have two bitmaps:

Bitmap* pngFrame;
Bitmap* pngEmblem;

I initialized them in a function I use, and I can display them no problem like this:

PAINTSTRUCT ps; 
BeginPaint(hwnd, &ps);
Gdiplus::Graphics* gfx = new Gdiplus::Graphics(ps.hdc); 
gfx->DrawImage(pngFrame, 80, 12); 
gfx->DrawImage(pngEmblem, 80 + ((17 - (INT)pngEmblem->GetWidth()) / 2), 12 + ((17 - (INT)pngEmblem->GetHeight()) / 2)); 
delete gfx;  
EndPaint(hwnd, &ps);

Now, that works all fine and dandy. However, in another event, when the user clicks a button. I would like to draw the pngFrame, draw the pngEmblem on top of it, and then save it as one picture.

For example (pseudocode):

gfx->DrawImage(pngFrame);
gfx->DrawImage(pngEmblem);
gfx->SaveTo(C:\\picture.png);

They are PNG files so it handles the transparency automatically. But yea, can I get some help with this one?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.