// JP opened flex table

Click to See Complete Forum and Search --> : GDI+ Save problem


Chirieac
May 9th, 2008, 01:57 PM
Hello! I have the next function:

void CaptureIt::SaveJPEG(const Image &bmp, const char *fileName, int quality)
{
CLSID encoderClsid;
EncoderParameters encoderParameters;

GetEncoderClsid(L"image/jpeg", &encoderClsid);

encoderParameters.Count = 1;
encoderParameters.Parameter[0].Guid = EncoderQuality;
encoderParameters.Parameter[0].Type = EncoderParameterValueTypeLong;
encoderParameters.Parameter[0].NumberOfValues = 1;

encoderParameters.Parameter[0].Value = &quality;

bmp.Save(L"", &encoderClsid, &encoderParameters);
}

When I try to compile I get this error on bmp.Save:
error C2663: 'Gdiplus::Image::Save' : 2 overloads have no legal conversion for 'this' pointer
Please help!

Chirieac
May 9th, 2008, 02:07 PM
Stupid me! I saw the error nr earlier but only I've made this thread I've tried a search on msdn library for error C2663. The problem was the const keyword on the first function parameter. Removed and worked.
Sorry for this tread.
Bye!

//JP added flex table