我找到一个解决的方法啦:通过位图来转换
//wRatio hRatio分别为Width和Height调整的百分比(%)
int ResizePicture(LPCWSTR lpSrcFile,LPCWSTR lpDstFile,int wRatio,int hRatio)
{
Image srcImg(lpSrcFile);
int srcWidth=srcImg.GetWidth();
int srcHeight=srcImg.GetHeight();
//计算调整后的Width和Height
int dstWidth=srcWidth*wRatio/100;
int dstHeight=srcHeight*hRatio/100;
// Construct a Graphics object based on the image.
Graphics imgGraphics(&srcImg);
Bitmap bitmap(dstWidth,dstHeight,&imgGraphics);
Graphics bmpGraphics(&bitmap);
bmpGraphics.DrawImage(&srcImg,0,0,dstWidth,dstHeight);
// Save the altered image.
LPWSTR lpExt=PathFindExtensionW(lpSrcFile);
lpExt++;
LPWSTR lpEncoder;
switch(*lpExt)
{
case L'J':
case L'j':
lpEncoder=L"image/jpeg";
break;
case L'P':
case L'p':
lpEncoder=L"image/png";
break;
case L'B':
case L'b':
lpEncoder=L"image/bmp";
break;
case L'G':
case L'g':
lpEncoder=L"image/gif";
break;
case L't':
case L'T':
lpEncoder=L"image/tiff";
break;
default:
lpEncoder=L"image/jpeg";
}