GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / GifCreateMultiFrameFromFile Method
The path of the file to open. Can be an empty string. If empty, prompts the user to select a file. You can subsequently use the GetLastPath() method to retrieve the path of the selected file.
Example





In This Topic
GifCreateMultiFrameFromFile Method (GdPictureImaging)
In This Topic
Creates a new editable multiframe Gif image based on an image file.
Syntax
'Declaration
 
Public Function GifCreateMultiFrameFromFile( _
   ByVal FilePath As String _
) As Integer
public int GifCreateMultiFrameFromFile( 
   string FilePath
)
public function GifCreateMultiFrameFromFile( 
    FilePath: String
): Integer; 
public function GifCreateMultiFrameFromFile( 
   FilePath : String
) : int;
public: int GifCreateMultiFrameFromFile( 
   string* FilePath
) 
public:
int GifCreateMultiFrameFromFile( 
   String^ FilePath
) 

Parameters

FilePath
The path of the file to open. Can be an empty string. If empty, prompts the user to select a file. You can subsequently use the GetLastPath() method to retrieve the path of the selected file.

Return Value

0: The image could not created. Use the GetStat() method to determine the reason this method failed. Non-zero: GdPicture image identifier. The created editable multiframe gif image.
Remarks
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