C# Class LibNoise.Writer.BMPWriter

Windows bitmap image writer class. This class creates a file in Windows bitmap (*.bmp) format given the contents of an image object. Writing the image To write the image to a file, perform the following steps: - Pass the filename to the Filename property. - Pass an Image object to the Image property. - Call the WriteFile(). TODO convert BMPWriter to an extensible writing strategy based on image format (bmp, png, jpg, ...)
Inheritance: AbstractWriter
Show file Open project: everbytes/LibNoise

Protected Properties

Property Type Description
_image System.Image

Public Methods

Method Description
WriteFile ( ) : void

Writes the contents of the image object to the file. @pre Filename has been previously defined. @pre Image has been previously defined. @throw ArgumentException See the preconditions. @throw IOException An I/O exception occurred. Possibly the file could not be written.

Protected Methods

Method Description
CalcWidthByteCount ( int width ) : int

Calculates the width of one horizontal line in the file, in bytes. Windows bitmap files require that the width of one horizontal line must be aligned to a 32-bit boundary.

Method Details

CalcWidthByteCount() protected method

Calculates the width of one horizontal line in the file, in bytes. Windows bitmap files require that the width of one horizontal line must be aligned to a 32-bit boundary.
protected CalcWidthByteCount ( int width ) : int
width int The width of the image, in points
return int

WriteFile() public method

Writes the contents of the image object to the file. @pre Filename has been previously defined. @pre Image has been previously defined. @throw ArgumentException See the preconditions. @throw IOException An I/O exception occurred. Possibly the file could not be written.
public WriteFile ( ) : void
return void

Property Details

_image protected property

The destination image
protected Image,System _image
return System.Image