C# Class BlogEngine.Core.FileSystem.Image

image specific class, will contain the extra methods and properties of an image
Inheritance: System.IO.File
Show file Open project: rasmuskl/ReSharperCourse

Public Methods

Method Description
CropImage ( int x, int y, int width, int height ) : Image

Crops an image by giving the crop start x & y co-ordinates and then the height & width to crop to. Making a perfect rectangle of the crop area.

Image ( ) : System

ctor, property free constructor, initiates the this.Image(file) passing in a null file reference

Image ( File obj ) : System

ctor, copys all the properties from the file object into the new object.

ModifyImage ( ) : Image

accepts change requests for an image for rotate & flip

ResizeImage ( Size newSize ) : Image

resizes the image to a new size. The image will be replaced

ResizeImage ( decimal Percent ) : Image

resizes the image to a new size based on a percentage

This may not be exactly to the percent as we must maintain aspect ratios.

ResizeImageThumbnail ( int MaxSize, byte originalContents ) : byte[]

Private Methods

Method Description
ArrayToBmp ( byte inArray ) : Bitmap

converts a byte array to a bitmap

BmpToArray ( Bitmap bmp ) : byte[]

converts a bitmap to an array

resizeImage ( System imgToResize, Size size ) : Image

resizes an image to specific size

Method Details

CropImage() public method

Crops an image by giving the crop start x & y co-ordinates and then the height & width to crop to. Making a perfect rectangle of the crop area.
public CropImage ( int x, int y, int width, int height ) : Image
x int the x co-ordinate
y int the y co-ordinate
width int the width to crop
height int the height to crop
return Image

Image() public method

ctor, property free constructor, initiates the this.Image(file) passing in a null file reference
public Image ( ) : System
return System

Image() public method

ctor, copys all the properties from the file object into the new object.
public Image ( File obj ) : System
obj System.IO.File
return System

ModifyImage() public method

accepts change requests for an image for rotate & flip
public ModifyImage ( ) : Image
return Image

ResizeImage() public method

resizes the image to a new size. The image will be replaced
public ResizeImage ( Size newSize ) : Image
newSize System.Drawing.Size the new Size for the image
return Image

ResizeImage() public method

resizes the image to a new size based on a percentage
This may not be exactly to the percent as we must maintain aspect ratios.
public ResizeImage ( decimal Percent ) : Image
Percent decimal
return Image

ResizeImageThumbnail() public static method

public static ResizeImageThumbnail ( int MaxSize, byte originalContents ) : byte[]
MaxSize int
originalContents byte
return byte[]