如下函数
    bool ChangeImageAlpha(const CString& imagePath, REAL alpha, const CString& savePath)
{
// Bitmap bitmap(L"imagePath");
Bitmap* bitmap=Bitmap::FromFile(L"imagePath");/* if (bitmap.GetLastStatus() != Ok)
return false;*/ int nWidth = bitmap->GetWidth();
int nHeight = bitmap->GetHeight(); // 构建新图像对象
Bitmap image(nWidth, nHeight);
Rect rect(0, 0, nWidth, nHeight); // 利用新图像对象绘制
Graphics graph(&image);
// CDC* pDC=GetDC();
// Graphics graph(pDC->GetSafeHdc()); // 构建颜色变换矩阵
ColorMatrix colorMatrix = {
1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, alpha, 0,
0, 0, 0, 0, 1 }; ImageAttributes imageAttr; imageAttr.SetColorMatrix(&colorMatrix); // 运用颜色变换矩阵绘制新图像
graph.DrawImage(bitmap, rect, 0, 0, nWidth, nHeight, UnitPixel, &imageAttr);
CLSID   encoderClsid; // 文件编码器的CLSID
CString strExt = savePath.Right(3); // 获得保存文件的扩展名
strExt.MakeLower(); // 根据扩展名获得不同的CLSID
if (strExt == L"png")
GetEncoderClsid(L"image/png", &encoderClsid);
else if (strExt == L"jpg")
GetEncoderClsid(L"image/jpeg", &encoderClsid);
else 
GetEncoderClsid(L"image/bmp", &encoderClsid); if (image.Save(L"savePath", &encoderClsid, NULL) == Ok)
     return true;
else
     return false;
}
当ChangeImageAlpha(L"pic.jpg",0.5,L"pic.png");这样调用该函数时,编译没有错误,可为什么不能把值传给bitmap呢?