C# Class BaconBuilder.Model.ImageManipulator

Show file Open project: Revelations/BaconApp Class Usage Examples

Public Methods

Method Description
ImageManipulator ( Bitmap bitmap ) : System

Constructor for the manipulator accepting a pre-created bitmap.

ImageManipulator ( string fileName ) : System

Constructor for the manipulator accepting a bitmap from file.

SaveImage ( string directory, string fileName ) : void

Saves the current image in the manipulator to a file.

SaveImage ( string directory, string fileName, ImageType type ) : void

Saves the current image in the manipulator to a file. Optional image format may be specified to output a certain image type.

ScaleImage ( Size size ) : void

Scales the size of an image to the given size. Does not preserve aspect ratio.

ScaleImage ( Size size, bool preserveAspectRatio ) : void

Scales the size of an image to the given size. Will optionally preserve aspect ratio and crop along one dimension if necessary to do so.

ScaleImage ( int width, int height ) : void

Scales the size of an image to the given width and height. Does not preserve aspect ratio.

ScaleImage ( int width, int height, bool preserveAspectRatio ) : void

Scales the size of an image to the given size. Will optionally preserve aspect ratio and crop along one dimension if necessary to do so.

Private Methods

Method Description
GetImageFormatInfo ( ImageType imageType ) : ImageFormat>.Tuple

Gets the file extension and System.Drawing.Imaging.ImageFormat associated with the selected format type.

Method Details

ImageManipulator() public method

Constructor for the manipulator accepting a pre-created bitmap.
public ImageManipulator ( Bitmap bitmap ) : System
bitmap System.Drawing.Bitmap The bitmap to perform manipulation on.
return System

ImageManipulator() public method

Constructor for the manipulator accepting a bitmap from file.
public ImageManipulator ( string fileName ) : System
fileName string
return System

SaveImage() public method

Saves the current image in the manipulator to a file.
public SaveImage ( string directory, string fileName ) : void
directory string Output directory.
fileName string Name of the output image.
return void

SaveImage() public method

Saves the current image in the manipulator to a file. Optional image format may be specified to output a certain image type.
public SaveImage ( string directory, string fileName, ImageType type ) : void
directory string Output directory.
fileName string Name of the output image.
type ImageType The desired output format of the image.
return void

ScaleImage() public method

Scales the size of an image to the given size. Does not preserve aspect ratio.
public ScaleImage ( Size size ) : void
size System.Drawing.Size The desired output image size.
return void

ScaleImage() public method

Scales the size of an image to the given size. Will optionally preserve aspect ratio and crop along one dimension if necessary to do so.
public ScaleImage ( Size size, bool preserveAspectRatio ) : void
size System.Drawing.Size The desired output image size.
preserveAspectRatio bool Whether to preserve the original aspect ration of the image or not.
return void

ScaleImage() public method

Scales the size of an image to the given width and height. Does not preserve aspect ratio.
public ScaleImage ( int width, int height ) : void
width int The desired output image width.
height int The desired output image height.
return void

ScaleImage() public method

Scales the size of an image to the given size. Will optionally preserve aspect ratio and crop along one dimension if necessary to do so.
public ScaleImage ( int width, int height, bool preserveAspectRatio ) : void
width int The desired output image width.
height int The desired output image height.
preserveAspectRatio bool Whether to preserve the original aspect ration of the image or not.
return void