C# Class BrightIdeasSoftware.ImageRenderer

Render an image that comes from our data source.
The image can be sourced from: a byte-array (normally when the image to be shown is stored as a value in a database) an int, which is treated as an index into the image list a string, which is treated first as a file name, and failing that as an index into the image list an ICollection of ints or strings, which will be drawn as consecutive images

If an image is an animated GIF, it's state is stored in the SubItem object.

By default, the image renderer does not render animations (it begins life with animations paused). To enable animations, you must call Unpause().

In the current implementation (2009-09), each column showing animated gifs must have a different instance of ImageRenderer assigned to it. You cannot share the same instance of an image renderer between two animated gif columns. If you do, only the last column will be animated.

Inheritance: BaseRenderer
Afficher le fichier Open project: soywiz/cspspemu

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
ImageRenderer ( ) : System

Make an empty image renderer

ImageRenderer ( bool startAnimations ) : System

Make an empty image renderer that begins life ready for animations

OnTimer ( Object state ) : void

This is the method that is invoked by the timer. It basically switches control to the listview thread.

Pause ( ) : void

Pause any animations

Render ( Graphics g, Rectangle r ) : void

Draw our image

Unpause ( ) : void

Unpause any animations

Méthodes protégées

Méthode Description
GetImageFromAspect ( ) : Image

Translate our Aspect into an image.

The strategy is: If its a byte array, we treat it as an in-memory image If it's an int, we use that as an index into our image list If it's a string, we try to load a file by that name. If we can't, we use the string as an index into our image list.

OnTimerInThread ( ) : void

This is the OnTimer callback, but invoked in the same thread as the creator of the ListView. This method can use all of ListViews methods without creating a CrossThread exception.

Method Details

GetImageFromAspect() protected méthode

Translate our Aspect into an image.
The strategy is: If its a byte array, we treat it as an in-memory image If it's an int, we use that as an index into our image list If it's a string, we try to load a file by that name. If we can't, we use the string as an index into our image list.
protected GetImageFromAspect ( ) : Image
Résultat Image

ImageRenderer() public méthode

Make an empty image renderer
public ImageRenderer ( ) : System
Résultat System

ImageRenderer() public méthode

Make an empty image renderer that begins life ready for animations
public ImageRenderer ( bool startAnimations ) : System
startAnimations bool
Résultat System

OnTimer() public méthode

This is the method that is invoked by the timer. It basically switches control to the listview thread.
public OnTimer ( Object state ) : void
state Object not used
Résultat void

OnTimerInThread() protected méthode

This is the OnTimer callback, but invoked in the same thread as the creator of the ListView. This method can use all of ListViews methods without creating a CrossThread exception.
protected OnTimerInThread ( ) : void
Résultat void

Pause() public méthode

Pause any animations
public Pause ( ) : void
Résultat void

Render() public méthode

Draw our image
public Render ( Graphics g, Rectangle r ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
Résultat void

Unpause() public méthode

Unpause any animations
public Unpause ( ) : void
Résultat void