Context
ReferencesAggregates 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
#public Color BackColour { get; set; }
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.
Bitmap
#public Bitmap Bitmap { get; }
Gets the bitmap associated with this paint event, if any. This field may be null.
Graphics
#public Graphics Graphics { get; }
Gets the graphics used for this paint event. This field is never null.
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.
Methods
Animate<T>
#Evaluate an animator. This method automatically schedules redraw events if those are needed for smooth animations.
Parameters:
| animated (Animated<T>) | Animator to evaluate. |
Returns: Animated value.
CreateFromBitmap
#Create a bitmap context.
Parameters:
| bitmap (Bitmap) | Underlying bitmap. |
| graphics (Graphics) | Graphics object associated with bitmap. |
Returns: Context.
CreateFromBitmap
#Create a bitmap context.
Parameters:
| bitmap (Bitmap) | Underlying bitmap, may not already be associated with a graphics object. |
Returns: Context.
CreateFromContent
#Create a content-space context.
Parameters:
| graphics (ControlGraphics) | Control graphics. |
Returns: Context.
CreateFromControl
#Create a control-space context.
Parameters:
| graphics (ControlGraphics) | Control graphics. |
Returns: 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.
Parameters:
| graphics (Graphics) | Graphics object. |
| background (Color) | Background colour. |
Returns: Context.
CreateFromScratch
#[EditorBrowsable(EditorBrowsableState.Never)]
public static Context CreateFromScratch(Graphics graphics, float zoom, IFlexControl control, Bitmap bitmap)
Create a context by setting all fields directly.
Parameters:
| graphics (Graphics) | |
| zoom (float) | |
| control (IFlexControl) | |
| bitmap (Bitmap) |