This documentation is for the old version. Go to the latest Graphics Mill docs

GifEncoderOptions.LastFrame Property

Gets/sets a value that specifies if the current frame is the last frame the global palette is generated for.

Namespace: Aurigma.GraphicsMill.Codecs
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)


Visual Basic
Public Property LastFrame As Boolean
public bool LastFrame { get; set; }

Property Value

Value that specifies if the last frame is reached.


If the optimization is enabled (the Optimized property is set to true), Graphics Mill for .NET will try to build a global palette which is common for all frames (other optimization activities are done as well, but they do not concern this property). Due a GIF format specification, no image data may be written before the global palette is saved. Therefore we cannot write a frame as soon as the AddFrame(IFrame) method is called. Instead of it we should store the frame in memory before the global palette will be generated and saved to the memory. Frames will be saved to the file only when the writer is closed.

Obviously, if you add too many frames, it will consume too much memory. To avoid this, set the LastFrame property to true on the frame we would like to stop. As soon as you do it, the global palette will be generated and all frames will be flushed into the file.

Another way to stop gathering statistics for the global palette is to specify a threshold for the number of frames to build a global palette for using the BasisOptimizationFrameCount property.

If you add some frames after global palette is generated, and all entries of palettes of these frames are the same as in the global palette, Graphics Mill for .NET automatically uses the global palette. However if at least one color will not be contained in the global palette, this frame will be saved with a local palette.

See Also