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
파일 보기 프로젝트 열기: soywiz/cspspemu

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