GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / GifSetFrameDisposal Method
GdPicture image identifier. The multiframe gif image.
Frame no between 1 and frame count.
Can be:1: Leave. Will leave the image in place to be entirely or partially overdrawn by the next image.2: Background. Will blank out the area used by the frame with the background color.3: Previous. Will return the logical canvas to the previous state before the image was drawn.
Example





In This Topic
GifSetFrameDisposal Method (GdPictureImaging)
In This Topic
Sets the "Frame disposal method" of a frame of an editable multiframe gif image. This method should be called before saving using the GifSaveMultiFrameToFile() method. This defines what to do with the logical canvas area after displaying this image.
Syntax
'Declaration
 
Public Function GifSetFrameDisposal( _
   ByVal ImageID As Integer, _
   ByVal Frame As Integer, _
   ByVal FrameDisposal As Integer _
) As GdPictureStatus
public GdPictureStatus GifSetFrameDisposal( 
   int ImageID,
   int Frame,
   int FrameDisposal
)
public function GifSetFrameDisposal( 
    ImageID: Integer;
    Frame: Integer;
    FrameDisposal: Integer
): GdPictureStatus; 
public function GifSetFrameDisposal( 
   ImageID : int,
   Frame : int,
   FrameDisposal : int
) : GdPictureStatus;
public: GdPictureStatus GifSetFrameDisposal( 
   int ImageID,
   int Frame,
   int FrameDisposal
) 
public:
GdPictureStatus GifSetFrameDisposal( 
   int ImageID,
   int Frame,
   int FrameDisposal
) 

Parameters

ImageID
GdPicture image identifier. The multiframe gif image.
Frame
Frame no between 1 and frame count.
FrameDisposal
Can be:1: Leave. Will leave the image in place to be entirely or partially overdrawn by the next image.2: Background. Will blank out the area used by the frame with the background color.3: Previous. Will return the logical canvas to the previous state before the image was drawn.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method works only with editable multiframe gif images.
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