C# Class Imazen.LightResize.Encoding

Provides adjustable Jpeg encoding and 32-bit PNG encoding methods
Mostra file Open project: imazen/lightresize

Public Methods

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

Looks up encoders by mime-type

SaveJpeg ( Image b, Stream target, int quality ) : void

Saves the specified image to the specified stream using jpeg compression of the specified quality.

SavePng ( Image img, Stream target ) : void

Saves the image in png form. If Stream 'target' is not seekable, a temporary MemoryStream will be used to buffer the image data into the stream

Method Details

GetImageCodecInfo() public static method

Looks up encoders by mime-type
public static GetImageCodecInfo ( string mimeType ) : System.Drawing.Imaging.ImageCodecInfo
mimeType string
return System.Drawing.Imaging.ImageCodecInfo

SaveJpeg() public static method

Saves the specified image to the specified stream using jpeg compression of the specified quality.
public static SaveJpeg ( Image b, Stream target, int quality ) : void
b Image
target Stream
quality int A number between 0 and 100. Defaults to 90 if passed a negative number. Numbers over 100 are truncated to 100. /// 90 is a *very* good setting. ///
return void

SavePng() public static method

Saves the image in png form. If Stream 'target' is not seekable, a temporary MemoryStream will be used to buffer the image data into the stream
public static SavePng ( Image img, Stream target ) : void
img Image
target Stream
return void