C# / .Net API Library Reference  4.3.2-74-ge1d4cca
Public Functions | Properties | Events
EncoderFormat Class Reference

The EncoderFormat class specifies service-side image encoder format parameters. By default, these parameters are the image mime type and quality. However, the methods in this class also allow you to specify any other custom parameters that you want to include with the image that is streamed to the client-side view. Such custom parameters could be used, for example, to display image metadata.

The EncoderFormat class is only needed if you choose to overwrite the default encoding configuration; this is rare as PureWeb provides relevant defaults to optimize for performance.

Constructors and Destructors

 EncoderFormat (string mimeType)
 
 EncoderFormat (string mimeType, int quality)
 

Public Functions

override bool Equals (object obj)
 
bool Equals (EncoderFormat other)
 
override int GetHashCode ()
 
void SetParameter (string key, string value)
 
bool TryGetParameter (string key, out string value)
 

Properties

string MimeType [get, set]
 
IEnumerable< KeyValuePair< string, string > > Parameters [get]
 
int Quality [get, set]
 

Events

EventHandler EncoderFormatChanged
 

Usage Description

override bool Equals ( object  obj)
inline

Checks whether the current instance is equal or not to the specified object; returns true if they are equal, otherwise returns false.

bool Equals ( EncoderFormat  other)
inline

Checks whether the current instance is equal or not to the specified other EncoderFormat object; returns true if they are equal, otherwise returns false.

override int GetHashCode ( )
inline

Returns this instance expressed as a hashcode.

void SetParameter ( string  key,
string  value 
)
inline

Adds a custom parameter to the EncoderFormat object, expressed as a key-value pair. You could use this method, for example, to send metadata along with the image.

bool TryGetParameter ( string  key,
out string  value 
)
inline

Checks whether the given parameter exists. If it does, returns true and assigns the value to the parameter.

Property Documentation

string MimeType
getset

Returns the mime type currently set in the EncoderFormat object.

IEnumerable<KeyValuePair<string, string> > Parameters
get

Adds a custom parameter to the EncoderFormat object, expressed as a key-value pair. You could use this method, for example, to send metadata along with the image.

int Quality
getset

Gets or sets an image encoding quality for the EncoderFormat object. Quality is an integer between 0 and 100 that defines the fidelity (overall clarity and number of visual artifacts) of the images to be generated by the service.

Providing a quality will override PureWeb 3 era server-side quality events.

Event Documentation

EventHandler EncoderFormatChanged

This event is fired whenever this EncoderFormat changes.