Cfiledialog fdlg (true, "jpg", "", ofn_hidereadonly | ofn_overwriteprompt, "JPG files (*. jpg) | *. jpg | ");
If (fdlg. domodal ()! = Idok) return;
Cimage imsrc, imdest;
Imsrc. Load (fdlg. getpathname ());
HDC = imsrc. getdc ();
CDC * PDC = CDC: fromhandle (HDC );
Cbitmap BMP;
BMP. createcompatiblebitmap (PDC, 152,200 );
CDC memdc;
Memdc. createcompatibledc (PDC );
Cbitmap * pold = memdc. SelectObject (& BMP );
: Setstretchbltmode (memdc. m_hdc, halftone );
: Setbrushorgex (memdc. m_hdc, 0, 0, null );
Imsrc. stretchblt (memdc. m_hdc, crect (152,200,)/* destrect */, crect (, imsrc. getwidth (), imsrc. getheight ()/* sourcerect */, srccopy );
// 152,200 is the width and height of the image you want (in pixels)
Hbitmap = (hbitmap) memdc. SelectObject (pold-> m_hobject );
Imdest. Attach (hbitmap); // load bitmap Resources
Cfiledialog fdlg1 (false, "BMP", "", ofn_hidereadonly | ofn_overwriteprompt, "BMP files (*. BMP) | *. BMP | ");
If (fdlg1.domodal ()! = Idok) return;
Imdest. Save (fdlg1.getpathname ());
Imsrc. releasedc ();
Imsrc. Destroy ();
Imdest. Destroy ();
Cimage converts an image to a specified pixel size