GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / GifAppendFrameFromFile Method
GdPicture image identifier. The editable multiframe gif image in which the frame will be added.
The path of the image to append within the editable multiframe gif image.
Example





In This Topic
GifAppendFrameFromFile Method (GdPictureImaging)
In This Topic
Appends a new frame from file to the end of an editable multiframe gif image.
Syntax
'Declaration
 
Public Function GifAppendFrameFromFile( _
   ByVal ImageID As Integer, _
   ByVal FilePath As String _
) As GdPictureStatus
public GdPictureStatus GifAppendFrameFromFile( 
   int ImageID,
   string FilePath
)
public function GifAppendFrameFromFile( 
    ImageID: Integer;
    FilePath: String
): GdPictureStatus; 
public function GifAppendFrameFromFile( 
   ImageID : int,
   FilePath : String
) : GdPictureStatus;
public: GdPictureStatus GifAppendFrameFromFile( 
   int ImageID,
   string* FilePath
) 
public:
GdPictureStatus GifAppendFrameFromFile( 
   int ImageID,
   String^ FilePath
) 

Parameters

ImageID
GdPicture image identifier. The editable multiframe gif image in which the frame will be added.
FilePath
The path of the image to append within the editable multiframe gif image.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
-This method can only be used with an editable multiframe gif image.

To check if an image is an editable multiframe gif image you can use the GifIsEditableMultiFrame() method.

To save modifications brought to the multiframe gif image you need to use the GifSaveMultiFrameToFile() method.

Supported formats are listed here: http://www.gdpicture.com/solutions/supported-formats/.

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