C# Класс 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.

Наследование: BaseRenderer
Показать файл Открыть проект

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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.

Описание методов

GetImageFromAspect() защищенный Метод

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
Результат Image

ImageRenderer() публичный Метод

Make an empty image renderer
public ImageRenderer ( ) : System
Результат System

ImageRenderer() публичный Метод

Make an empty image renderer that begins life ready for animations
public ImageRenderer ( bool startAnimations ) : System
startAnimations bool
Результат System

OnTimer() публичный Метод

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
Результат void

OnTimerInThread() защищенный Метод

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
Результат void

Pause() публичный Метод

Pause any animations
public Pause ( ) : void
Результат void

Render() публичный Метод

Draw our image
public Render ( Graphics g, Rectangle r ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
Результат void

Unpause() публичный Метод

Unpause any animations
public Unpause ( ) : void
Результат void