This class enables you to write BMP images.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public NotInheritable Class BmpWriter _ Inherits FormatWriter
public sealed class BmpWriter : FormatWriter
BMP (Bitmap) is a standard image format mainly used on the Microsoft Windows platform. BMP images can range from black and white (1 bit per pixel) up to 32 bit color (16.7 million colors), in that way bitmap image format can store both indexed and true color images. There are two main BMP formats exist: Windows bitmap formats and OS/2 bitmap format. All of these formats supports RLE-type compression for 4 and 8 bits per pixel palette images.
BMP files can store only single image per file.
You can use BmpWriter class instead of the Save(String, IEncoderOptions) method of the Bitmap. In particular it enables you to save the image asynchronously.
The BmpWriter class usage is demonstrated below:
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg") Dim writer As New Aurigma.GraphicsMill.Codecs.BmpWriter("C:\Mountain.bmp") Dim frame As New Aurigma.GraphicsMill.Codecs.BmpFrame( _ Aurigma.GraphicsMill.Codecs.CompressionType.None) frame.SetBitmap(bitmap) bitmap.Dispose() writer.AddFrame(frame) frame.Dispose() writer.Dispose()
using (Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg")) { using (Aurigma.GraphicsMill.Codecs.BmpWriter writer = new Aurigma.GraphicsMill.Codecs.BmpWriter()) { writer.Open(@"C:\Mountain.bmp"); using (Aurigma.GraphicsMill.Codecs.BmpFrame frame = new Aurigma.GraphicsMill.Codecs.BmpFrame()) { frame.Compression = Aurigma.GraphicsMill.Codecs.CompressionType.None; 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. |
Format24bppRgb | 24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. |
Format32bppRgb | 32 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. The rest 8 bits are unused. |
Format32bppArgb | 32 bits per pixel. RGB with alpha channel. 8 bits each are used for the alpha, red, green, and blue components. |