C# Class TrakHound.Tools.Image_Functions

显示文件 Open project: TrakHound/TrakHound-Community

Public Methods

Method Description
CalculateAverageColor ( Bitmap bm ) : Color
CropImage ( Image img, Rectangle cropArea ) : Image

Returns a cropped image based on the 'cropArea' set

CropImageToCenter ( Image img ) : Image

Returns a Image that is automatically cropped to the center of the image

GetImageFromFile ( string path ) : Image
ImageFromFile ( Uri uri ) : Image
SetImageSize ( Image image, int width, int height ) : Image

Returns a resized image based on the Width and Height given

Method Details

CalculateAverageColor() public static method

public static CalculateAverageColor ( Bitmap bm ) : Color
bm System.Drawing.Bitmap
return System.Drawing.Color

CropImage() public static method

Returns a cropped image based on the 'cropArea' set
public static CropImage ( Image img, Rectangle cropArea ) : Image
img Image
cropArea System.Drawing.Rectangle
return Image

CropImageToCenter() public static method

Returns a Image that is automatically cropped to the center of the image
public static CropImageToCenter ( Image img ) : Image
img Image
return Image

GetImageFromFile() public static method

public static GetImageFromFile ( string path ) : Image
path string
return Image

ImageFromFile() public static method

public static ImageFromFile ( Uri uri ) : Image
uri System.Uri
return Image

SetImageSize() public static method

Returns a resized image based on the Width and Height given
public static SetImageSize ( Image image, int width, int height ) : Image
image Image
width int
height int
return Image