Bitmap saving problem
i'm trying to load an image into a dialog window, shrink it, then save that shrinked image back to the disk. i shrink it like this:
Problem is that the dlg area which dosen't occupy the shrinked image becomes black, and when i save the image the black part is also saved as the bmp. Howto save only the shrinked image, without the black area?
StretchBlt(g_hMemDC, 0, 0, SCREENWIDTH, SCREENHEIGHT,hdcDesk,0,0,SCREENWIDTH*2,SCREENHEIGHT*2,SRCCOPY);
Thanx for any help.
I guess you need to resize (create another one?) your g_hMemDC?
Create another bitmap in memory with CreateBitmap() or whatever it is, with the new shrunk dimensions, fill it with your HDC, then save it to disk.
thx that worked.
::StretchBlt(g_hMemDC, 0, 0, SCREENWIDTH, SCREENHEIGHT,hdcDesk,0,0,SCREENWIDTH*2,SCREENHEIGHT*2,SRCCOPY);
HBITMAP hbmpshrnk = CreateCompatibleBitmap(g_hMemDC, SCREENWIDTH/2, SCREENHEIGHT/2);
PBITMAPINFO bmpinfo = CreateBitmapInfoStruct(hwndgl, hbmpshrnk);