GdPicture.NET Reference Guide
GifCreateMultiFrameFromFile Method (GdPictureImaging)
Example 





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.
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/.
Example
Apply negative effect on all frames of an animated gif image.
Dim i As Integer
Dim GifImageID As Integer = oGdPictureImaging.GifCreateMultiFrameFromFile("input.gif")
Dim FrameCount As Integer = oGdPictureImaging.GifGetFrameCount(GifImageID)
For i = 1 To FrameCount
   oGdPictureImaging.GifSelectFrame(GifImageID, i)
   oGdPictureImaging.FxNegative(GifImageID)
Next i
oGdPictureImaging.GifSaveMultiFrameToFile(GifImageID,  "output.gif")
oGdPictureImaging.ReleaseGdPictureImage(GifImageID)
Creating an animated gif from separated image frames.
Dim oGdPictureImaging As New GdPictureImaging
Dim multiGif As Integer = oGdPictureImaging.GifCreateMultiFrameFromFile("frames\frame1.jpg")
oGdPictureImaging.GifAppendFrameFromFile(multiGif, "frames\frame2.jpg")
oGdPictureImaging.GifAppendFrameFromFile(multiGif, "frames\frame3.jpg")
oGdPictureImaging.GifAppendFrameFromFile(multiGif, "frames\frame4.jpg")
oGdPictureImaging.GifAppendFrameFromFile(multiGif, "frames\frame5.jpg")
oGdPictureImaging.GifSetLoopCount(multiGif, -1)
'Set frames time to 1 second.
For i As Integer = 1 To oGdPictureImaging.GifGetFrameCount(multiGif)
   oGdPictureImaging.GifSetFrameTime(multiGif, i, 100)
Next i
oGdPictureImaging.GifSaveMultiFrameToFile(multiGif, "frames\animated.gif")
oGdPictureImaging.ReleaseGdPictureImage(multiGif)
oGdPictureImaging.Dispose()
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
GetStat Method