bool GetCodecClsid(LPCTSTR lpstrFormat, CLSID &clsid)
{
UINT nNum = 0, nSize = 0;
Gdiplus::GetImageEncodersSize(&nNum, &nSize) == Gdiplus::Ok;
Gdiplus::ImageCodecInfo *pInfo = (Gdiplus::ImageCodecInfo *)malloc(nSize);
if(Gdiplus::GetImageEncoders(nNum, nSize, pInfo) != Gdiplus::Ok)
{
free(pInfo);
}
LPCWSTR lpstr = lpstrFormat;
for(int nIndex = 0; nIndex < nNum; ++nIndex)
{
if(wcscmp(pInfo[nIndex].MimeType, lpstr) == 0)
{
clsid = pInfo[nIndex].Clsid;
return true;
}
}
return false;
};
void DrawWatermark()
{
USES_CONVERSION;
int nPicWidth = 0;
int nPicHeight = 0;
ULONG_PTR m_gdiplusToken;
Gdiplus::GdiplusStartup