ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Properties | List of all members
ImageResizer.Encoding.IEncoder Interface Reference

An image encoder. Exposes methods for suitability checking, encoding, transparency compatibility checking, and mime-type/extension calculation. More...

Inheritance diagram for ImageResizer.Encoding.IEncoder:
Inheritance graph
[legend]

Public Member Functions

IEncoder CreateIfSuitable (ResizeSettings settings, object original)
 If the encoder can handle the requirements specified by 'settings' and 'source', it should return an encoder instance. If not, it should return null. More...
 
void Write (Image i, Stream s)
 Encodes the image to the specified stream More...
 

Properties

bool SupportsTransparency [get]
 True if the output format will support transparency as it is currently configured. More...
 
string MimeType [get]
 Returns the appropriate mime-time for the output format as currently configured. More...
 
string Extension [get]
 Returns a file extension appropriate for the output format as currently configured, without a leading dot. More...
 

Detailed Description

An image encoder. Exposes methods for suitability checking, encoding, transparency compatibility checking, and mime-type/extension calculation.

Definition at line 13 of file IEncoder.cs.

Member Function Documentation

IEncoder ImageResizer.Encoding.IEncoder.CreateIfSuitable ( ResizeSettings  settings,
object  original 
)

If the encoder can handle the requirements specified by 'settings' and 'source', it should return an encoder instance. If not, it should return null.

Parameters
settingsRequest settings, like format, quality, colors, dither, etc.
originalMay be a Drawing.Image instance, a path, or null. To provide both, set Image.tag to the path. Helps the encoder detect the original format if the format was not specified. May also be used for palette generation hinting by some encoders.
Returns

Implemented in ImageResizer.Plugins.PrettyGifs.PrettyGifs, ImageResizer.Plugins.FreeImageEncoder.FreeImageEncoderPlugin, ImageResizer.Plugins.WicEncoder.WicEncoderPlugin, ImageResizer.Plugins.Basic.DefaultEncoder, ImageResizer.Plugins.WebPEncoder.WebPEncoderPlugin, and ImageResizer.Plugins.WpfBuilder.WpfEncoderPlugin.

void ImageResizer.Encoding.IEncoder.Write ( Image  i,
Stream  s 
)

Encodes the image to the specified stream

Parameters
i
s

Property Documentation

string ImageResizer.Encoding.IEncoder.Extension
get

Returns a file extension appropriate for the output format as currently configured, without a leading dot.

Definition at line 45 of file IEncoder.cs.

string ImageResizer.Encoding.IEncoder.MimeType
get

Returns the appropriate mime-time for the output format as currently configured.

Definition at line 40 of file IEncoder.cs.

Referenced by ImageResizer.Plugins.AnimatedGifs.AnimatedGifs.buildToStream().

bool ImageResizer.Encoding.IEncoder.SupportsTransparency
get

True if the output format will support transparency as it is currently configured.

Definition at line 35 of file IEncoder.cs.


The documentation for this interface was generated from the following file: