# ControlGraphics class

Namespace: [Grasshopper2.UI.Flex](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.flex.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public class ControlGraphics : IDisposable
```

Provides several graphics states for drawing in different coordinate systems.

## Constructors

- [ControlGraphics](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/ctor.md): (5 overloads) Create a control graphics object based on a bitmap, showing a specific region of content. The region is scaled to fit the bitmap without distorting it, so a region whose proportions differ from the bitmap leaves margins on two sides.

## Properties

- [AssociatedControl](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/associatedcontrol.md): Gets the control associated with this graphics object.
- [Content](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/content.md): Gets a graphics objects which can be used to draw geometry in content coordinates. Do not cache this graphics object for prolonged periods of time.
- [ContentContext](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/contentcontext.md): Gets the graphics context for the content space.
- [Control](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/control.md): Gets a graphics objects which can be used to draw geometry in control coordinates. Do not cache this graphics object for prolonged periods of time.
- [ControlContext](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/controlcontext.md): Gets the graphics context for the control space.
- [IsDisposed](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/isdisposed.md): Gets whether these graphics have been disposed.
- [ScreenScale](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/screenscale.md): Gets or sets the screen scaling factor for the current control. This value is set automatically when these graphics are constructed, however it can be overridden by any developer who knows what they are doing.
- [Zoom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/zoom.md): Gets the zoom factor used for the content.

## Methods

- [Adjust](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/adjust.md): (3 overloads) Adjust a numeric value based on the relevant screen scale.
- [Dispose](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/dispose.md): Dispose the internal graphics object, making sure all drawing calls are flushed.
- [ProjectionState](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/projectionstate.md): Gets a disposable object which stores the current projection state. Get and dispose this object if you intend to switch from [ControlGraphics.Control](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/control.md) to [ControlGraphics.Content](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/content.md) or vice versa in the middle of another drawing routine.
- [ResetScreenScale](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.controlgraphics/resetscreenscale.md): Reset the screenscale factor to the system value.
