16,551
社区成员
发帖
与我相关
我的任务
分享
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
BITMAP bMap;
bmp.GetBitmap(&bMap);
bMap.bmWidth = 200;
bMap.bmHeight = 200;
bmp.Detach();
bmp.CreateBitmapIndirect(&bMap);
int nWidth = 100; //源图宽
int nHeight = 100; //源图高
Bitmap bmpSrc(nWidth, nHeight, PixelFormat24bppRGB/*24位图*/); //vc用gdi+最好不要用new
//在bmpSrc画东西.......
Bitmap bmpDst(nWidth * 2, nHeight * 2, PixelFormat24bppRGB);
Graphics *pGDIbmpDst = Graphics::FromImage(&bmpDst);
pGDIbmpDst->DrawImage(&bmpSrc,0,0, nWidth * 2, nHeight * 2); // 指定宽和高
delete pGDIbmpDst;