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

SwfWriter Class

This class enables you to write SWF movies.

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

Syntax

Visual Basic
Public NotInheritable Class SwfWriter _
	Inherits FormatWriter
C#
public sealed class SwfWriter : FormatWriter

Remarks

SWF format was developed by Macromedia Inc. It stands for "Shockwave File Format". The SWF file format is ideal for vector graphics that may have audio and may even be interactive. To open the SWF file the web browser may use the flash plug-in.

Graphics Mill for .NET allows creating SWF movies built from the multiple bitmaps. Bitmaps can be indexed or 8 bit per channel RGB images (both with and without alpha).

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





Supported Pixel Formats

Member NameDescription
Format1bppIndexed1 bit per pixel. Indexed.
Format4bppIndexed4 bits per pixel. Indexed.
Format8bppIndexed8 bits per pixel. Indexed.
Format8bppGrayScale8 bits per pixel. Grayscale. 8 bits are used for luminosity level.
Format16bppAGrayScale16 bits per pixel. Grayscale with alpha channel. 8 bits are used for alpha channel and other 8 bits are used for luminosity level.
Format24bppRgb24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components.
Format32bppArgb32 bits per pixel. RGB with alpha channel. 8 bits each are used for the alpha, red, green, and blue components.
Format32bppCmyk32 bits per pixel. CMYK. 8 bits each are used for the cyan, magenta, yellow, and black components.
Format40bppAcmyk40 bits per pixel. CMYK with alpha channel. 8 bits each are used for the alpha, cyan, magenta, yellow, and black components.

See Also

Reference