请教下为何新图像没有保存下来?
//读取旧图像
CImage img;
img.Load("d:\\pic\\1.bmp");
HBITMAP hbmp = img.Detach();
CBitmap cbmp; cbmp.Attach(hbmp);
//获取旧图像信息
BITMAP bm;
cbmp.GetBitmap(&bm);
//创建新图像
CBitmap newbmp;
newbmp.CreateBitmap(bm.bmWidth, bm.bmHeight, bm.bmPlanes, bm.bmBitsPixel, bm.bmBits);
//将新图像保存到本地文件;
CImage img2;
img2.Attach(newbmp.operator HBITMAP());
img2.Save("d:\\123.bmp");