Eu am gasit o solutie dar imi deseneaza si in fereastra aplicatiei, iar daca redimensionez aiurea fereastra nu ies ok imaginile, mie practic imi face un fel de print screen

Orice sugestii sunt binevenite!

void CPict::SaveImage(std::string *path)
{
CPaintDC dc(this); // device context for painting
CRect drawingArea;
GetClientRect(&drawingArea);
int height = drawingArea.Height();
int width = drawingArea.Width();
// ...
// - aici se deseneaza efectiv imaginea
// ...
//create a memory dc
CDC memDC;
memDC.CreateCompatibleDC(&dc);
//Create a memory bitmap
CBitmap newbmp;
newbmp.CreateCompatibleBitmap(&dc, width, height);
//select the bitmap in the memory dc
CBitmap *pOldBitmap = memDC.SelectObject(&newbmp);
//blit from screen into memory dc
memDC.BitBlt(0, 0, width, height, &dc, 0, 0, SRCCOPY);
//select old bitmap back into the memory dc
memDC.SelectObject(pOldBitmap);
//release the Display DC
ReleaseDC(&dc);
CImage img;
img.Attach((HBITMAP)newbmp.Detach());
std::string img = *path + ".png";
img.Save(img.c_str(), Gdiplus::ImageFormatPNG);
}