This class enables you to write SWF movies.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public NotInheritable Class SwfWriter _ Inherits FormatWriter
public sealed class SwfWriter : FormatWriter
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).
To create an animated SWF movie we need to use the SwfWriter class. The movie is created from the several JPEG files.
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()
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); } } } }
Member Name | Description |
---|---|
Format1bppIndexed | 1 bit per pixel. Indexed. |
Format4bppIndexed | 4 bits per pixel. Indexed. |
Format8bppIndexed | 8 bits per pixel. Indexed. |
Format8bppGrayScale | 8 bits per pixel. Grayscale. 8 bits are used for luminosity level. |
Format16bppAGrayScale | 16 bits per pixel. Grayscale with alpha channel. 8 bits are used for alpha channel and other 8 bits are used for luminosity level. |
Format24bppRgb | 24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. |
Format32bppArgb | 32 bits per pixel. RGB with alpha channel. 8 bits each are used for the alpha, red, green, and blue components. |
Format32bppCmyk | 32 bits per pixel. CMYK. 8 bits each are used for the cyan, magenta, yellow, and black components. |
Format40bppAcmyk | 40 bits per pixel. CMYK with alpha channel. 8 bits each are used for the alpha, cyan, magenta, yellow, and black components. |