CVOImage 显示GIF 图片问题 ..... DecompressImageIndirect 失败....

slyzhang 2005-08-08 08:35:46
hFile = CreateFile(pcszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
if (hFile == INVALID_HANDLE_VALUE)
{
AfxMessageBox(L"Open file Error");
return FALSE;
}

// Fill in the 'DecompressImageInfo' structure
dii.dwSize = sizeof( DecompressImageInfo ); // Size of this structure
dii.pbBuffer = szBuffer; // Pointer to the buffer to use for data
dii.dwBufferMax = 1024; // Size of the buffer
dii.dwBufferCurrent = 0; // The amount of data which is current in the buffer
dii.phBM = &m_hbitmap; // Pointer to the bitmap returned (can be NULL)
dii.ppImageRender = NULL; // Pointer to an IImageRender object (can be NULL)
dii.iBitDepth = GetDeviceCaps(hdc,BITSPIXEL); // Bit depth of the output image
dii.lParam = ( LPARAM ) hFile; // User parameter for callback functions
dii.hdc = g_hdc; // HDC to use for retrieving palettes
dii.iScale = g_iScale; // Scale factor (1 - 100)
dii.iMaxWidth = g_iMaxWidth; // Maximum width of the output image
dii.iMaxHeight = g_iMaxHeight; // Maxumum height of the output image
dii.pfnGetData = GetImageData; // Callback function to get image data
dii.pfnImageProgress = ImageProgress; // Callback function to notify caller of progress decoding the image
dii.crTransparentOverride = ( UINT ) -1; // If this color is not (UINT)-1, it will override the
// transparent color in the image with this color. (GIF ONLY)

// Process and decompress the image data
hr = DecompressImageIndirect( &dii );
if (hr == NULL)
{
AfxMessageBox(L"DecompressImageIndirect file Error");
return FALSE;
}


CVOImage 显示GIF 图片问题 ..... DecompressImageIndirect 失败.... hr一直是NULL
...全文
262 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
slyzhang 2006-02-10
  • 打赏
  • 举报
回复
再没有人回了么
gearge 2005-08-24
  • 打赏
  • 举报
回复
在ARM下可以么?有何好的办法。
LabAdmin 2005-08-24
  • 打赏
  • 举报
回复
用SHLoadImageFile(pDoc->MapfileName)装入图片试试,使用说明在EVC自带的帮助里没有,查.Net2003的帮助。

19,502

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧