使用ICDecompressGetFormat遇到的错误

leafank 2007-05-02 04:27:39

BITMAPINFO m_InInfo,m_Test;



if(ICDecompressGetFormat(m_CV.hic, &m_InInfo, &m_Test)!=ICERR_OK)
AfxMessageBox("格式获取错误");

m_InInfo为输入格式,m_Test为输出格式

监视m_Test的bmiheader各个参数发现biSizeImage值与输入格式中的值相等

这个是什么原因?
...全文
236 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yxz_lp 2007-05-02
  • 打赏
  • 举报
回复
这是应用的例子,你在看看自己的代码。
LPBITMAPINFOHEADER lpbiIn, lpbiOut;

// *lpbiIn must be initialized to the input format.

dwFormatSize = ICCompressGetFormatSize(hIC, lpbiIn);
h = GlobalAlloc(GHND, dwFormatSize);
lpbiOut = (LPBITMAPINFOHEADER)GlobalLock(h);
ICCompressGetFormat(hIC, lpbiIn, lpbiOut);
leafank 2007-05-02
  • 打赏
  • 举报
回复
我在之前调用过ICFormatSize,返回的SIZE也正常
yxz_lp 2007-05-02
  • 打赏
  • 举报
回复
ICDecompressGetFormat
The ICDecompressGetFormat macro requests the output format of the decompressed data from a video decompression driver. You can use this macro or explicitly call the ICM_DECOMPRESS_GET_FORMAT message.

DWORD ICDecompressGetFormat(
hic,
lpbiInput,
lpbiOutput
);
Parameters

hic

Handle to a decompressor.

lpbiInput

Pointer to a BITMAPINFO structure containing the input format.

lpbiOutput

Pointer to a BITMAPINFO structure to contain the output format. You can specify zero to request only the size of the output format, as in the ICDecompressGetFormatSize macro.

Return Values

If lpbiOutput is zero, returns the size of the structure.

If lpbiOutput is nonzero, returns ICERR_OK if successful or an error otherwise.

Remarks

If lpbiOutput is nonzero, the driver should fill the BITMAPINFO structure with the default output format corresponding to the input format specified for lpbiInput. If the compressor can produce several formats, the default format should be the one that preserves the greatest
yxz_lp 2007-05-02
  • 打赏
  • 举报
回复
第一次调用 ICDecompressGetFormat(m_CV.hic, &m_InInfo, &m_Test)
m_Test为空应该返回结构的size。

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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