C# Class Blog.Common.Utils.Helpers.ImageHelper

Inheritance: IImageHelper
ファイルを表示 Open project: jsnmgpnty/Blogness2.0 Class Usage Examples

Public Methods

Method Description
ByteArrayToImage ( byte byteArray ) : Image
CreateGifThumbnail ( string filename, string destinationPath, string thumbnailPrefix ) : bool
CreateThumbnail ( string filename, string destinationPath, string thumbnailPrefix ) : bool
CreateVideoThumbnail ( string filename, string destinationPath, string thumbnailPrefix ) : bool
GenerateImagePath ( int id, string guid, string storageRoot ) : string
GetComputedImageSize ( int width, int height ) : Size
ImageToByteArray ( Image image ) : byte[]
ResizeImage ( Image mg, Size newSize ) : Image
SaveImage ( Image image, string destinationPath, string fileName ) : bool
SaveImage ( byte bytes, string destinationPath, string fileName ) : bool

Private Methods

Method Description
GetEncoder ( ImageFormat format ) : System.Drawing.Imaging.ImageCodecInfo

Method Details

ByteArrayToImage() public method

public ByteArrayToImage ( byte byteArray ) : Image
byteArray byte
return Image

CreateGifThumbnail() public method

public CreateGifThumbnail ( string filename, string destinationPath, string thumbnailPrefix ) : bool
filename string
destinationPath string
thumbnailPrefix string
return bool

CreateThumbnail() public method

public CreateThumbnail ( string filename, string destinationPath, string thumbnailPrefix ) : bool
filename string
destinationPath string
thumbnailPrefix string
return bool

CreateVideoThumbnail() public method

public CreateVideoThumbnail ( string filename, string destinationPath, string thumbnailPrefix ) : bool
filename string
destinationPath string
thumbnailPrefix string
return bool

GenerateImagePath() public method

public GenerateImagePath ( int id, string guid, string storageRoot ) : string
id int
guid string
storageRoot string
return string

GetComputedImageSize() public method

public GetComputedImageSize ( int width, int height ) : Size
width int
height int
return System.Drawing.Size

ImageToByteArray() public method

public ImageToByteArray ( Image image ) : byte[]
image Image
return byte[]

ResizeImage() public method

public ResizeImage ( Image mg, Size newSize ) : Image
mg Image
newSize System.Drawing.Size
return Image

SaveImage() public method

public SaveImage ( Image image, string destinationPath, string fileName ) : bool
image Image
destinationPath string
fileName string
return bool

SaveImage() public method

public SaveImage ( byte bytes, string destinationPath, string fileName ) : bool
bytes byte
destinationPath string
fileName string
return bool