C# Class ImageManager.ImageService

Inheritance: IImageService
Datei anzeigen Open project: cimex/ImageManager Class Usage Examples

Public Methods

Method Description
Delete ( string fullFilePath ) : void
Get ( string relativeFilePath, int maxSideSize ) : Bitmap
Get ( string relativeFilePath, int maxWidth, int maxHeight ) : Bitmap
Get ( string relativeFilePath, int width, int height, ImageMod imageMod, string hexBackgroundColour, AnchorPosition anchor ) : Bitmap
Get ( Stream file, int maxSideSize, OutputFormat outputFormat ) : Stream
Get ( Stream file, int width, int height, ImageMod imageMod, string hexBackgroundColour, AnchorPosition anchor, OutputFormat outputFormat ) : Stream
Get ( Stream file, int maxWidth, int maxHeight, OutputFormat outputFormat ) : Stream
Get ( string relativeFilePath, int maxSideSize, OutputFormat outputFormat ) : byte[]
Get ( string relativeFilePath, int width, int height, ImageMod imageMod, string hexBackgroundColour, AnchorPosition anchor, OutputFormat outputFormat ) : byte[]
Get ( string relativeFilePath, int maxWidth, int maxHeight, OutputFormat outputFormat ) : byte[]
GetAndCrop ( string relativeFilePath, int targetWidth, int targetHeight, double widthRatio, double heightRatio, double leftRatio, double topRatio ) : Bitmap

This returns a specified crop

GetAndCrop ( Stream file, int targetWidth, int targetHeight, double widthRatio, double heightRatio, double leftRatio, double topRatio, OutputFormat outputFormat ) : Stream

This returns a specified crop

GetAndCrop ( string relativeFilePath, int targetWidth, int targetHeight, double widthRatio, double heightRatio, double leftRatio, double topRatio, OutputFormat outputFormat ) : byte[]

This returns a specified crop

GetCached ( string relativeFilePath, int width, int height, ImageMod imageMod, string hexBackgroundColour, AnchorPosition anchor, OutputFormat outputFormat ) : byte[]
ImageService ( IFileService fileService, HttpContext context ) : System
SaveForWeb ( string sourceFileName, string relativeSourcePath, string relativeTargetPath ) : bool

Private Methods

Method Description
CreateThumbnail ( Image image, int defaultWidth, int defaultHeight ) : Bitmap
getDefault ( int width, int height ) : Bitmap
loadImage ( Stream file ) : Image
loadImage ( string relativeFilePath ) : Image

Method Details

Delete() public method

public Delete ( string fullFilePath ) : void
fullFilePath string
return void

Get() public method

public Get ( string relativeFilePath, int maxSideSize ) : Bitmap
relativeFilePath string
maxSideSize int
return System.Drawing.Bitmap

Get() public method

public Get ( string relativeFilePath, int maxWidth, int maxHeight ) : Bitmap
relativeFilePath string
maxWidth int
maxHeight int
return System.Drawing.Bitmap

Get() public method

public Get ( string relativeFilePath, int width, int height, ImageMod imageMod, string hexBackgroundColour, AnchorPosition anchor ) : Bitmap
relativeFilePath string
width int
height int
imageMod ImageMod
hexBackgroundColour string
anchor AnchorPosition
return System.Drawing.Bitmap

Get() public method

public Get ( Stream file, int maxSideSize, OutputFormat outputFormat ) : Stream
file Stream
maxSideSize int
outputFormat OutputFormat
return Stream

Get() public method

public Get ( Stream file, int width, int height, ImageMod imageMod, string hexBackgroundColour, AnchorPosition anchor, OutputFormat outputFormat ) : Stream
file Stream
width int
height int
imageMod ImageMod
hexBackgroundColour string
anchor AnchorPosition
outputFormat OutputFormat
return Stream

Get() public method

public Get ( Stream file, int maxWidth, int maxHeight, OutputFormat outputFormat ) : Stream
file Stream
maxWidth int
maxHeight int
outputFormat OutputFormat
return Stream

Get() public method

public Get ( string relativeFilePath, int maxSideSize, OutputFormat outputFormat ) : byte[]
relativeFilePath string
maxSideSize int
outputFormat OutputFormat
return byte[]

Get() public method

public Get ( string relativeFilePath, int width, int height, ImageMod imageMod, string hexBackgroundColour, AnchorPosition anchor, OutputFormat outputFormat ) : byte[]
relativeFilePath string
width int
height int
imageMod ImageMod
hexBackgroundColour string
anchor AnchorPosition
outputFormat OutputFormat
return byte[]

Get() public method

public Get ( string relativeFilePath, int maxWidth, int maxHeight, OutputFormat outputFormat ) : byte[]
relativeFilePath string
maxWidth int
maxHeight int
outputFormat OutputFormat
return byte[]

GetAndCrop() public method

This returns a specified crop
public GetAndCrop ( string relativeFilePath, int targetWidth, int targetHeight, double widthRatio, double heightRatio, double leftRatio, double topRatio ) : Bitmap
relativeFilePath string e.g. asdf/asdf.jpg
targetWidth int
targetHeight int
widthRatio double
heightRatio double
leftRatio double
topRatio double
return System.Drawing.Bitmap

GetAndCrop() public method

This returns a specified crop
public GetAndCrop ( Stream file, int targetWidth, int targetHeight, double widthRatio, double heightRatio, double leftRatio, double topRatio, OutputFormat outputFormat ) : Stream
file Stream
targetWidth int
targetHeight int
widthRatio double
heightRatio double
leftRatio double
topRatio double
outputFormat OutputFormat
return Stream

GetAndCrop() public method

This returns a specified crop
public GetAndCrop ( string relativeFilePath, int targetWidth, int targetHeight, double widthRatio, double heightRatio, double leftRatio, double topRatio, OutputFormat outputFormat ) : byte[]
relativeFilePath string e.g. asdf/asdf.jpg
targetWidth int
targetHeight int
widthRatio double
heightRatio double
leftRatio double
topRatio double
outputFormat OutputFormat
return byte[]

GetCached() public method

public GetCached ( string relativeFilePath, int width, int height, ImageMod imageMod, string hexBackgroundColour, AnchorPosition anchor, OutputFormat outputFormat ) : byte[]
relativeFilePath string
width int
height int
imageMod ImageMod
hexBackgroundColour string
anchor AnchorPosition
outputFormat OutputFormat
return byte[]

ImageService() public method

public ImageService ( IFileService fileService, HttpContext context ) : System
fileService IFileService
context System.Web.HttpContext
return System

SaveForWeb() public method

public SaveForWeb ( string sourceFileName, string relativeSourcePath, string relativeTargetPath ) : bool
sourceFileName string
relativeSourcePath string
relativeTargetPath string
return bool