CImage 类调用GetDC()Debug 出现断言 我有ReleaseDC()可是没效果

CImage 类调用GetDC()Debug 出现断言 我有ReleaseDC()可是没效果

不调用 GetDC 就不会出现断言 搞不定啊 求帮助 跪求

顺便再求 下 有什么方法 可以对图片 进行 不在乎质量 压缩吗

CString filepathname = "C:\\20160728000.jpg", filepathname1 = "C:\\结果.jpg";
int width = 0, height = 0;
CImage image, image1;
image.Load(filepathname); //加载图片  

width = image.GetWidth();
height = image.GetHeight();

image1.Create(400, 400, image.GetBPP()); // 创建一个目标存储对象 

image.BitBlt(image1.GetDC(), 0, 0, 400, 400, 200, 50, SRCCOPY);  //SRCAND //原图的一半到目标对象里  

HDC hdc = image1.GetDC();// 如果不调用 GetDC 就不会出现断言
image1.ReleaseDC();   // 释放资源  释放了这个资源还是不行 

图片说明

image1.GetDC()这个返回了0,很可能是image.GetBPP()返回了非法的值,原因是你的图片格式不被支持。