C# Class FECipherVit.ImageHelper

Mostra file Open project: sdercolin/FECipherVit

Public Methods

Method Description
GetCodecInfo ( string mimeType ) : System.Drawing.Imaging.ImageCodecInfo

获取图像编码解码器的所有相关信息

GetImageCodecInfo ( ImageFormat format ) : System.Drawing.Imaging.ImageCodecInfo
GetImageSize ( Image picture, int percent ) : Size

根据百分比获取图片的尺寸

GetImageSize ( Image picture, int width, int height ) : Size

根据设定的大小返回图片的大小,考虑图片长宽的比例问题

GetThumbnailImage ( Image image, int width, int height ) : Image
GetThumbnailImageKeepRatio ( Image image, int width, int height ) : Image

生成缩略图,并保持纵横比

SaveImage ( Image image, string savePath, ImageFormat format ) : void

Private Methods

Method Description
SaveImage ( Image image, string savePath, System.Drawing.Imaging.ImageCodecInfo ici ) : void

高质量保存图片

Method Details

GetCodecInfo() public static method

获取图像编码解码器的所有相关信息
public static GetCodecInfo ( string mimeType ) : System.Drawing.Imaging.ImageCodecInfo
mimeType string 包含编码解码器的多用途网际邮件扩充协议 (MIME) 类型的字符串
return System.Drawing.Imaging.ImageCodecInfo

GetImageCodecInfo() public static method

public static GetImageCodecInfo ( ImageFormat format ) : System.Drawing.Imaging.ImageCodecInfo
format System.Drawing.Imaging.ImageFormat
return System.Drawing.Imaging.ImageCodecInfo

GetImageSize() public static method

根据百分比获取图片的尺寸
public static GetImageSize ( Image picture, int percent ) : Size
picture Image
percent int
return System.Drawing.Size

GetImageSize() public static method

根据设定的大小返回图片的大小,考虑图片长宽的比例问题
public static GetImageSize ( Image picture, int width, int height ) : Size
picture Image
width int
height int
return System.Drawing.Size

GetThumbnailImage() public static method

public static GetThumbnailImage ( Image image, int width, int height ) : Image
image Image
width int
height int
return Image

GetThumbnailImageKeepRatio() public static method

生成缩略图,并保持纵横比
public static GetThumbnailImageKeepRatio ( Image image, int width, int height ) : Image
image Image
width int
height int
return Image

SaveImage() public static method

public static SaveImage ( Image image, string savePath, ImageFormat format ) : void
image Image
savePath string
format System.Drawing.Imaging.ImageFormat
return void