Visual c++ 在C++中旋转图像 我对C++很陌生。 Image im(L"C:\\Temp\\SnapShotOutput.jpg"); im.RotateFlip(Rotate90FlipNone); im.Save("SampleImage_rotated.jpg");

Visual c++ 在C++中旋转图像 我对C++很陌生。 Image im(L"C:\\Temp\\SnapShotOutput.jpg"); im.RotateFlip(Rotate90FlipNone); im.Save("SampleImage_rotated.jpg");,visual-c++,Visual C++,我正在尝试上面的代码旋转图像和保存。。。 它不起作用。在第三行编译失败 'Gdiplus::Image::Save' : no overloaded function takes 1 arguments 它给出了上述错误。 有人能帮我吗。你也应该设置其他参数。代码来自 GetEncoderCSID函数定义如下: Image image(L"C:\\Temp\\SnapShotOutput.jpg"); image.RotateFlip(Rotate90FlipNone); // Save t

我正在尝试上面的代码旋转图像和保存。。。 它不起作用。在第三行编译失败

'Gdiplus::Image::Save' : no overloaded function takes 1 arguments
它给出了上述错误。
有人能帮我吗。

你也应该设置其他参数。代码来自

GetEncoderCSID函数定义如下:

Image image(L"C:\\Temp\\SnapShotOutput.jpg");
image.RotateFlip(Rotate90FlipNone);

// Save the altered image as PNG
CLSID pngClsid;
GetEncoderClsid(L"image/png", &pngClsid);
image.Save(L"SampleImage_rotated.png", &pngClsid, NULL);

// Save the altered image as JPG
CLSID jpegClsid;
GetEncoderClsid(L"image/jpeg", &jpegClsid);
image.Save(L"SampleImage_rotated.jpg", &jpegClsid, NULL);
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
{
   UINT  num = 0;          // number of image encoders
   UINT  size = 0;         // size of the image encoder array in bytes

   ImageCodecInfo* pImageCodecInfo = NULL;

   GetImageEncodersSize(&num, &size);
   if(size == 0)
      return -1;  // Failure

   pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
   if(pImageCodecInfo == NULL)
      return -1;  // Failure

   GetImageEncoders(num, size, pImageCodecInfo);

   for(UINT j = 0; j < num; ++j)
   {
      if( wcscmp(pImageCodecInfo[j].MimeType, format) == 0 )
      {
         *pClsid = pImageCodecInfo[j].Clsid;
         free(pImageCodecInfo);
         return j;  // Success
      }    
   }

   free(pImageCodecInfo);
   return -1;  // Failure
}