GdPicture image identifier. The multiframe gif image.
Frame no between 1 and frame count.
Example





In This Topic
GdPicture14 Namespace / GdPictureImaging Class / GifGetFrameTime Method

GifGetFrameTime Method (GdPictureImaging)

In This Topic
Returns the "frame time" of a frame of a multiframe gif image. Frame time is the amount of time in ms to display the frame for (GIF specific - the value stored in the file is centiseconds (1/100th of a second)).
Syntax
'Declaration
 
Public Function GifGetFrameTime( _
   ByVal ImageID As Integer, _
   ByVal Frame As Integer _
) As Integer
public int GifGetFrameTime( 
   int ImageID,
   int Frame
)
public function GifGetFrameTime( 
    ImageID: Integer;
    Frame: Integer
): Integer; 
public function GifGetFrameTime( 
   ImageID : int,
   Frame : int
) : int;
public: int GifGetFrameTime( 
   int ImageID,
   int Frame
) 
public:
int GifGetFrameTime( 
   int ImageID,
   int Frame
) 

Parameters

ImageID
GdPicture image identifier. The multiframe gif image.
Frame
Frame no between 1 and frame count.

Return Value

The frame time of the selected frame of the multiframe gif image.
Remarks
This method works with both editable multiframe gif images and ones opened as read-only.

This method requires the Image Documents component to run.

Example
Creating a multiframe Gif image based on image files.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // Create a new editable multiframe Gif image based on an image file and append frames from files.
    int imageID = gdpictureImaging.GifCreateMultiFrameFromFile("frame1.bmp");
    gdpictureImaging.GifAppendFrameFromFile(imageID, "frame2.bmp");
    gdpictureImaging.GifAppendFrameFromFile(imageID, "frame3.bmp");
    gdpictureImaging.GifAppendFrameFromFile(imageID, "frame4.bmp");
    gdpictureImaging.GifAppendFrameFromFile(imageID, "frame5.bmp");
 
    // Set the number of times the animation should be played, 0 = infinite.
    gdpictureImaging.GifSetLoopCount(imageID, 0);
 
    // Set the "frame time" for each and every frame to 1s and the frame disposal to leave the image in place to beentirely or partially overdrawn by the next image.
    int frameCount = gdpictureImaging.GifGetFrameCount(imageID);
    for (int frameNo = 1; frameNo <= frameCount; frameNo++)
    {
        gdpictureImaging.GifSetFrameTime(imageID, frameNo, 100);
        gdpictureImaging.GifSetFrameDisposal(imageID, frameNo, 1);
    }
 
    gdpictureImaging.GifSaveMultiFrameToFile(imageID, "image.gif");
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also