# Context class

Namespace: [Grasshopper2.Eto.Drawing](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.eto.drawing.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
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](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/backcolour.md): 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](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/bitmap.md): Gets the bitmap associated with this paint event, if any. This field may be null.
- [Control](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/control.md): Gets the control associated with this paint event, if any. This field may be null.
- [Graphics](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/graphics.md): Gets the graphics used for this paint event. This field is never null.
- [IconFilter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/iconfilter.md): Gets the icon colour filter associated with this context.
- [IconPalette](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/iconpalette.md): Gets th icon special colour lookup palette associated with this context.
- [RedrawRequired](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/redrawrequired.md): 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.
- [Zoom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/zoom.md): Gets the zoom of the context.
- [ZoomInverse](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/zoominverse.md): Gets the inverse of the zoom.

## Methods

- [Animate<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/animate.md): Evaluate an animator. This method automatically schedules redraw events if those are needed for smooth animations.
- [CreateFromBitmap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/createfrombitmap.md): (2 overloads, static) Create a bitmap context.
- [CreateFromContent](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/createfromcontent.md): (static) Create a content-space context.
- [CreateFromControl](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/createfromcontrol.md): (static) Create a control-space context.
- [CreateFromGraphics](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/createfromgraphics.md): (static) Create a context from a disassociated graphics instance. You should use another CreateFromXXXX method if you have either the relevant control or bitmap.
- [CreateFromScratch](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/createfromscratch.md): (static) Create a context by setting all fields directly.
- [Invalidate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.eto.drawing.context/invalidate.md): Set the RedrawRequired state to true.
