ControlGraphics
ReferencesProvides several graphics states for drawing in different coordinate systems.
Constructors
ControlGraphics
#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.
public ControlGraphics()
Bitmap
bitmap,
Bitmap.
RectangleF
region
Region of content to show, in content coordinates. An empty region draws content at its own coordinates from the top left corner.
ControlGraphics
#Create a control graphics object based on a bitmap. Content is drawn at its own coordinates, starting from the top left corner of the bitmap.
public ControlGraphics()
Bitmap
bitmap
Bitmap.
ControlGraphics
#Create a control graphics object around a borrowed graphics, showing a specific region of content.
public ControlGraphics()
Graphics
graphics,
Graphics to draw with.
RectangleF
bounds,
Bounds of the surface being drawn on.
RectangleF
region
Region of content to show, in content coordinates. An empty region draws content at its own coordinates from the top left corner.
ControlGraphics
#Create a control graphics object around a graphics which belongs to somebody else, so that anything drawing through a Context can be used on a plain Eto control. The graphics is borrowed, not owned, and is left alone on disposal.
public ControlGraphics()
Graphics
graphics,
Graphics to draw with.
RectangleF
bounds
Bounds of the surface being drawn on.
ControlGraphics
#Create a new control graphics object.
public ControlGraphics()
control,
Transformation needed to draw stuff in control coordinates.
Graphics
graphics
Graphics to use.
Properties
Content
#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.
public Graphics Content { get; }
Control
#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.
public Graphics Control { get; }
ScreenScale
#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.
Methods
Dispose
#Dispose the internal graphics object, making sure all drawing calls are flushed.
public void Dispose()