C# Class Tp.Components.ImageHelper

Show file Open project: TargetProcess/Target-Process-Plugins

Public Methods

Method Description
CropImage ( Bitmap bitmap, Rectangle cropRect ) : Bitmap
CropImageToSquare ( Bitmap bitmap ) : Bitmap
GetThumbnail ( Bitmap initImage, int templateWidth, int templateHeight ) : Bitmap
GetThumbnail ( Stream stream, int templateWidth, int templateHeight ) : Bitmap
IsImage ( Stream stream ) : bool
ResizeAndRound ( Bitmap bitmap, int maxWidth, int maxHeight ) : Bitmap
ResizeImage ( Bitmap bitmap, int maxWidth, int maxHeight, bool withBorder ) : Bitmap
ResizeImage ( Stream stream, int maxWidth, int maxHeight, bool withBorder ) : Bitmap
ResizeImageAnyway ( Image image, int width, int height, bool withBorder ) : Bitmap
RoundCorners ( Bitmap startImage, int radious, Color color ) : Bitmap

Private Methods

Method Description
DrawImage ( Bitmap initImage, int templateWidth, int templateHeight, int initWidth, int initHeight ) : Bitmap

Method Details

CropImage() public static method

public static CropImage ( Bitmap bitmap, Rectangle cropRect ) : Bitmap
bitmap System.Drawing.Bitmap
cropRect System.Drawing.Rectangle
return System.Drawing.Bitmap

CropImageToSquare() public static method

public static CropImageToSquare ( Bitmap bitmap ) : Bitmap
bitmap System.Drawing.Bitmap
return System.Drawing.Bitmap

GetThumbnail() public static method

public static GetThumbnail ( Bitmap initImage, int templateWidth, int templateHeight ) : Bitmap
initImage System.Drawing.Bitmap
templateWidth int
templateHeight int
return System.Drawing.Bitmap

GetThumbnail() public static method

public static GetThumbnail ( Stream stream, int templateWidth, int templateHeight ) : Bitmap
stream Stream
templateWidth int
templateHeight int
return System.Drawing.Bitmap

IsImage() public static method

public static IsImage ( Stream stream ) : bool
stream Stream
return bool

ResizeAndRound() public static method

public static ResizeAndRound ( Bitmap bitmap, int maxWidth, int maxHeight ) : Bitmap
bitmap System.Drawing.Bitmap
maxWidth int
maxHeight int
return System.Drawing.Bitmap

ResizeImage() public static method

public static ResizeImage ( Bitmap bitmap, int maxWidth, int maxHeight, bool withBorder ) : Bitmap
bitmap System.Drawing.Bitmap
maxWidth int
maxHeight int
withBorder bool
return System.Drawing.Bitmap

ResizeImage() public static method

public static ResizeImage ( Stream stream, int maxWidth, int maxHeight, bool withBorder ) : Bitmap
stream Stream
maxWidth int
maxHeight int
withBorder bool
return System.Drawing.Bitmap

ResizeImageAnyway() public static method

public static ResizeImageAnyway ( Image image, int width, int height, bool withBorder ) : Bitmap
image Image
width int
height int
withBorder bool
return System.Drawing.Bitmap

RoundCorners() public static method

public static RoundCorners ( Bitmap startImage, int radious, Color color ) : Bitmap
startImage System.Drawing.Bitmap
radious int
color Color
return System.Drawing.Bitmap