C# Class Utilities.Media.ImageHelper

Helper class for graphics processing.
显示文件 Open project: feanz/Utilities

Public Methods

Method Description
ConvertToBytes ( Image image ) : byte[]

Converts an image to a byte array.

ConvertToBytes ( Image image, ImageFormat format ) : byte[]

Converts an image to a byte array.

ConvertToImage ( byte content ) : Image

Convert byte arry to an image object.

ConvertToThumbNail ( byte imageContents, int thumbNailWidth, int thumbNailHeigth ) : byte[]

Convert the image contents as a byte[] into a thumbnail represented by another byte[].

GetDimensions ( byte imageContents ) : int>.Tuple

Returns the height and width of the image.

Method Details

ConvertToBytes() public method

Converts an image to a byte array.
public ConvertToBytes ( Image image ) : byte[]
image Image Image to convert.
return byte[]

ConvertToBytes() public method

Converts an image to a byte array.
public ConvertToBytes ( Image image, ImageFormat format ) : byte[]
image Image Image to convert.
format System.Drawing.Imaging.ImageFormat The format of the image.
return byte[]

ConvertToImage() public static method

Convert byte arry to an image object.
public static ConvertToImage ( byte content ) : Image
content byte The bytes representing the image.
return Image

ConvertToThumbNail() public static method

Convert the image contents as a byte[] into a thumbnail represented by another byte[].
public static ConvertToThumbNail ( byte imageContents, int thumbNailWidth, int thumbNailHeigth ) : byte[]
imageContents byte The byte[] for the original contents.
thumbNailWidth int Width for thumbnail
thumbNailHeigth int Height for thumbnail
return byte[]

GetDimensions() public static method

Returns the height and width of the image.
public static GetDimensions ( byte imageContents ) : int>.Tuple
imageContents byte Byte array with converted image.
return int>.Tuple