Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/143.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何旋转ATL::CImage对象_C++_Image_Atl - Fatal编程技术网

C++ 如何旋转ATL::CImage对象

C++ 如何旋转ATL::CImage对象,c++,image,atl,C++,Image,Atl,我的问题基本上是,如何旋转windowsATL::CImage对象 我已使用windows ATL CImage对象加载JPG图像,例如: CImage myImage; myImage.Load(L"IMG1.JPG"); 我还设法改变像素(使像素更亮)并保存新图像,现在我正在努力旋转图像 我只需要能够以90度的增量旋转,因此任意旋转将是一个额外的奖励,仅演示,忽略错误处理,一开始不应该这样做,只需使用GDI+图像而不是ATL图像,并节省像素复制的往返时间 Bitmap* gdiPlusBit

我的问题基本上是,如何旋转windows
ATL::CImage
对象

我已使用windows ATL CImage对象加载JPG图像,例如:

CImage myImage; myImage.Load(L"IMG1.JPG");
我还设法改变像素(使像素更亮)并保存新图像,现在我正在努力旋转图像


我只需要能够以90度的增量旋转,因此任意旋转将是一个额外的奖励,仅演示,忽略错误处理,一开始不应该这样做,只需使用GDI+图像而不是ATL图像,并节省像素复制的往返时间

Bitmap* gdiPlusBitmap=Bitmap::FromHandle(atlBitmap.Detach());
gdiPlusBitmap->RotateFlip(Rotate90FlipNone);
HBITMAP hbmp;
gdiPlusBitmap->GetHBITMAP(Color::White, &hbmp);
atlBitmap.Attach(hbmp);

这正是我要求的,谢谢。我将采纳您的建议,直接使用GDI+检索图像等:)