MagickSetImageFormat(mw, "ICO"); //设置这个后, MagickGetImageBlob 才能返回正确的值 size_t length;
PBYTE pIcoData = MagickGetImageBlob(mw, &length);
//printf("length:%ld\n", length); //HICON hIcon = NULL;
int offset = LookupIconIdFromDirectoryEx(pIcoData, TRUE, width_thumbnail, height_thumbnail, LR_DEFAULTCOLOR);
//printf("offset:%d\n", offset); if(offset != )
{
*hIcon = CreateIconFromResourceEx(pIcoData + offset, , TRUE, 0x30000, width_thumbnail, height_thumbnail, LR_DEFAULTCOLOR);
} MagickRelinquishMemory(pIcoData); //注意Blob使用完后,释放内存