Image.GetFrameCount(FrameDimension) 方法


返回指定维度的帧数。Returns the number of frames of the specified dimension.

 int GetFrameCount(System::Drawing::Imaging::FrameDimension ^ dimension);
public int GetFrameCount (System.Drawing.Imaging.FrameDimension dimension);
member this.GetFrameCount : System.Drawing.Imaging.FrameDimension -> int
Public Function GetFrameCount (dimension As FrameDimension) As Integer



FrameDimension,它指定维度类型的标识。A FrameDimension that specifies the identity of the dimension type.


指定维度中的帧数。The number of frames in the specified dimension.


此方法返回有关多帧图像的信息,这些图像分为两种样式:多页和多个分辨率。This method returns information about multiple-frame images, which come in two styles: multiple page and multiple resolution.

多页图像是包含多个图像的图像。A multiple-page image is an image that contains more than one image. 每个页面都包含一个图像(或帧)。Each page contains a single image (or frame). 通常会连续显示这些页面(或图像或帧)以生成一个动画序列,如动画 gif 文件。These pages (or images, or frames) are typically displayed in succession to produce an animated sequence, such as an animated .gif file.

多解析图像是包含不同分辨率的图像的多个副本的映像。A multiple-resolution image is an image that contains more than one copy of an image at different resolutions. 这通常由 MIP 映射使用,其中显示的图像大小决定了用于绘制的图像的分辨率。This is commonly used by MIP mapping where the displayed image size determines the resolution of the image used for drawing. GDI+GDI+ 可以支持任意数量的页(或图像或帧)以及任意数量的分辨率。can support an arbitrary number of pages (or images, or frames), as well as an arbitrary number of resolutions. 定义的维度是 FrameDimension的属性。The defined dimensions are properties of the FrameDimension.