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

SwfFrame Class

This class represents a frame of the SWF format.

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

Syntax

Visual Basic
Public NotInheritable Class SwfFrame _
	Inherits Frame
C#
public sealed class SwfFrame : Frame

Examples

To create an animated SWF movie we need to use the SwfWriter class. The movie is created from the several JPEG files.

Visual Basic
Dim dir As String = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\"
Dim images As String() = {"Blue hills.jpg", "Sunset.jpg", "Water lilies.jpg", "Winter.jpg"}

Dim bitmap As New Aurigma.GraphicsMill.Bitmap

Dim writer As New Aurigma.GraphicsMill.Codecs.SwfWriter("C:\Mountain.swf")

For Each image As String In images
    bitmap.Load(dir & image)

    Dim frame As New Aurigma.GraphicsMill.Codecs.SwfFrame
    frame.Compression = Aurigma.GraphicsMill.Codecs.CompressionType.Jpeg
    frame.Quality = 30
    frame.Delay = 100
    frame.SetBitmap(bitmap)

    writer.AddFrame(frame)

    frame.Dispose()
Next

bitmap.Dispose()

writer.Dispose()
C#
string dir = @"C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\";
string[] images = {"Blue hills.jpg", "Sunset.jpg", "Water lilies.jpg", "Winter.jpg"};

using (Aurigma.GraphicsMill.Bitmap bitmap = 
           new Aurigma.GraphicsMill.Bitmap())
{
    using (Aurigma.GraphicsMill.Codecs.SwfWriter writer = 
               new Aurigma.GraphicsMill.Codecs.SwfWriter(@"C:\Mountain.swf"))
    {
        foreach (string image in images)
        {
            bitmap.Load(dir + image);

            using (Aurigma.GraphicsMill.Codecs.SwfFrame frame = 
                       new Aurigma.GraphicsMill.Codecs.SwfFrame())
            {
                frame.Compression = Aurigma.GraphicsMill.Codecs.CompressionType.Jpeg;
                frame.Quality = 30;
                frame.Delay = 100;
                frame.SetBitmap(bitmap);

                writer.AddFrame(frame);
            }
        }
    }
}

Inheritance Hierarchy

Thread Safety

Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.

Object Model




See Also

Reference