Gdiplus::Image::GetFrameDimensionsCount() 返回一个所谓的“维数” -- 这到底是个什么概念?

lzg0001 2008-07-05 08:31:19

我测试了一下,常见图片格式中,JPG、BMP 函数调用返回的结果都是 0,GIF 返回的结果都是 1,GIF 不就是有多个帧图片,按照一定时间顺序显示就形成了动画吗?这个“维数”到底指什么?

谢谢!
...全文
349 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzg0001 2008-07-20
  • 打赏
  • 举报
回复
谢谢,不过决不是帧数,帧数有另外的获取方法。
my_girlf 2008-07-08
  • 打赏
  • 举报
回复
The Image::GetFrameDimensionsCount() method gets the number of frame dimension identifiers in the image dimensions.

UINT GetFrameDimensionsCount()
Parameters
This method has no parameters.

Return Values
This method returns the number of frame dimensions.

Remarks
This method returns information about multiframe images, which come in two styles: multipage and multiresolution. A multipage image is an image that contains more than one image. Each page contains a single image (or frame). These pages (or images, or frames) are typically displayed in succession to produce an animated sequence, such as in an animated GIF file.

A multiresolution image is an image that contains more than one copy of an image at different resolutions. This is commonly used by MIP mapping, where the displayed image size determines the resolution of the image used for drawing.

GDI+ can support an arbitrary number of pages (or images, or frames), as well as an arbitrary number of resolutions.

GDI+的Image对象提供了直接的对GIF、TIF文件格式的支持。调用Image对象的成员函数GetFrameDimensionsCount可以得到Image对象的Dimension数。每个Dimension通过一个GUID标示。函数GetFrameDimensionsList可以返回所有Dimension的GUID值。第一个GUID值保存在函数参数pDimensionsIDs数组的索引0处。GetFrameCount可以得到每个Dimension里有多少个Frame。简单示例代码:
Image* image = new Image(L"Multiframe.gif");
UINT count = 0;
count = image->GetFrameDimensionsCount();
GUID *pDimensionIDs=(GUID*)new GUID[count];
image->GetFrameDimensionsList(pDimensionIDs, count);
WCHAR strGuid[39];
StringFromGUID2(pDimensionIDs[0], strGuid, 39);
UINT frameCount=image->GetFrameCount(&pDimensionIDs[0]);

delete []pDimensionIDs;
并不是所有的GIF文件都是含有多帧的,所以我们在显示GIF的时候可以通过上面的代码根据frameCount的值判断这个GIF文件是否有多个帧。


我的理解是image的维面中含有帧的数量。

15,979

社区成员

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

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