Context

References
public sealed class Context
Aggregates a bunch of information and functionality for drawing in graphics context. Primarily, a Context is better than a Graphics object as it provides information about the target object (either a bitmap or a control), and it allows for the animation of values and automatic invalidation of said target.

Properties

BackColour

#
Gets or sets the background of this context. This is not going to be correct for any given location, especially after some values have been drawn. If the value is transparent, it has not been set.
public Color BackColour { get; set; }

Bitmap

#
Gets the bitmap associated with this paint event, if any. This field may be null.
public Bitmap Bitmap { get; }

Control

#
Gets the control associated with this paint event, if any. This field may be null.
public IFlexControl Control { get; }

Graphics

#
Gets the graphics used for this paint event. This field is never null.
public Graphics Graphics { get; }

IconFilter

#
Gets the icon colour filter associated with this context.
public Func<Color, Color> IconFilter { get; set; }

IconPalette

#
Gets th icon special colour lookup palette associated with this context.
public IconPalette IconPalette { get; set; }

RedrawRequired

#
Gets whether another redraw will be triggered as soon as this one completes. This is usually indicative of some sort of animation not having finished yet.
public bool RedrawRequired { get; }

Zoom

#
Gets the zoom of the context.
public float Zoom { get; }

ZoomInverse

#
Gets the inverse of the zoom.
public float ZoomInverse { get; }

Methods

Animate<T>

#
Evaluate an animator. This method automatically schedules redraw events if those are needed for smooth animations.
public T Animate<T>(
animated
Animator to evaluate.
)
Animated value.

CreateFromBitmap

#
Create a bitmap context.
public static Context CreateFromBitmap(
Bitmap
bitmap,
Underlying bitmap.
Graphics
graphics
Graphics object associated with bitmap.
)
Context.

CreateFromBitmap

#
Create a bitmap context.
public static Context CreateFromBitmap(
Bitmap
bitmap
Underlying bitmap, may not already be associated with a graphics object.
)
Context.

CreateFromContent

#
Create a content-space context.
public static Context CreateFromContent(
graphics
Control graphics.
)
Context.

CreateFromControl

#
Create a control-space context.
public static Context CreateFromControl(
graphics
Control graphics.
)
Context.

CreateFromGraphics

#
Create a context from a disassociated graphics instance. You should use another CreateFromXXXX method if you have either the relevant control or bitmap.
public static Context CreateFromGraphics(
Graphics
graphics,
Graphics object.
Color
background
Background colour.
)
Context.

CreateFromScratch

#
Create a context by setting all fields directly.
[EditorBrowsable(EditorBrowsableState.Never)] public static Context CreateFromScratch(
Graphics
graphics,
zoom,
control,
Bitmap
bitmap
)

Invalidate

#
Set the RedrawRequired state to true.
public void Invalidate()