NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ImageGenerator Methods

The methods of the ImageGenerator class are listed below. For a complete list of ImageGenerator class members, see the ImageGenerator Members topic.

Public:

CreateBitmap CreateBitmap() may be overridden in derived classes; one common case would be, for example, if the user wanted to create the initial bitmap based on an image file already stored on disk.
Draw Draw() takes a Graphics object as an argument and uses GDI+ functions to draw to the object. This method must be defined in derived classes.
Equals (inherited from Object) Determines whether the specified Object is the same instance as the current Object. Subclasses are expected to override this method to support value equality (not reference equality).
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetImage GetImage() takes a Hashtable of parameters, defined by the user, that describe how to render the ImageGenerator control, and returns an object of type GeneratedImage which wraps the image and is handled by its own handler. Note that in all other methods, we use type IDictionary as a parameter for flexibility, but GetImage() has to take an argument of type Hashtable since WebRemoting will not allow GetImage() to take a IDictionary as an argument since IDictionary is an abstract class.
GetType (inherited from Object) Gets the Type of the Object.
ImageGeneratorBitDepthToPixelFormat ImageGeneratorBitDepthToPixelFormat takes an ImageGeneratorBitDepth (which all have simple names like "BitDepth8" and "BitDepth16") and converts it to the PixelFormat object that can actually be used by the Bitmap constructor. There is no corresponding method to convert PixelFormat variables to ImageGeneratorBitDepths because we never need one.
ImageGeneratorImageFormatToImageFormat ImageGeneratorImageFormatToImageFormat takes an ImageGeneratorImageFormat and converts it to the ImageFormat object that can actually be used by GDI+. ImageGenerator uses its own enum since (1) it does not need to use all of the ImageFormat types that GDI+ uses, (2) ImageFormat is not a real enum so it cannot be edited properly in the property grid. There is no corresponding method to convert ImageFormat objects to ImageGeneratorImageFormats because we never need one.
ToString (inherited from Object) Returns a String that represents the current Object.

Protected:

Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by the Garbage Collector (GC). This method may be ignored by the runtime; therefore, necessary cleanup operations should be done elsewhere.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

ImageGenerator Class | System.Web.UI.WebControls Namespace