谢谢~我现在就在配置Cximage~ |- C/C++ Code Generation |- Use run-time library : Multithreaded DLL (must be the same for | all the linked libraries) //应该只要是多线程DLL即可,DEBUG的也行 |- Struct member alignment : must be the same for all the linked libraries|- Precompiled headers : not using precompiled headers |- Preprocessor |- Additional Include Directories: ..\cximage这什么意思啊~在工程里根本找不到啊
谢谢~我现在就在配置Cximage~
|- C/C++
Code Generation
|- Use run-time library : Multithreaded DLL (must be the same for | all the linked libraries) //应该只要是多线程DLL即可,DEBUG的也行
|- Struct member alignment : must be the same for all the linked libraries|- Precompiled headers : not using precompiled headers
|- Preprocessor
|- Additional Include Directories: ..\cximage这什么意思啊~在工程里根本找不到啊
点击资源视图,右键项目,添加资源,点击bitmap,导入需要的图
不过貌似BMP格式的方便些,在属性中有IDB, //从外部加载BMP图
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP11);
CDC *pDc = GetDC();
CDC memDC;
memDC.CreateCompatibleDC(pDc);
memDC.SelectObject(&bitmap);
BITMAP bmp;
bitmap.GetBitmap(&bmp);
CRect rect;
GetClientRect(&rect);
pDc->StretchBlt(0,0,rect.Width(),rect.Height(),&memDC,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
memDC.DeleteDC();
::DeleteObject(&bitmap);
2.Cimage将JPG转换成BMP然后在把BMP转为JPG输出图片------->这个用CImage的load和Save方法就能实现,load一个jpg图片,save成bmp图片。
CImage m_img;