Click or drag to resize

Graphics Class

Graphics context object for drawing operations
Inheritance Hierarchy

Namespace:  Eto.Drawing
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public class Graphics : Widget

The Graphics type exposes the following members.

Constructors
  NameDescription
Protected methodGraphics
Initializes a new instance of the Graphics class.
Public methodGraphics(Bitmap)
Initializes a new instance of the Generator class to draw on the given image
Public methodGraphics(GraphicsIHandler)
Initializes a new instance of the Graphics class with the specified platform handler
Top
Properties
  NameDescription
Public propertyAntiAlias
Gets or sets a value indicating that drawing operations will use anti-aliasing
Public propertyClipBounds
Gets the bounds of the clipping region
Public propertyCurrentTransform
Gets a copy of the current transform.
Public propertyDPI
Gets the dots per inch of the current graphics context. Usually 96 for windows and 72 for other systems
Public propertyImageInterpolation
Gets or sets the interpolation mode for drawing images
Public propertyIsRetained
Gets a value indicating the graphics sub-system is a retained system (e.g. WPF)
Public propertyPixelOffsetMode
Gets or sets the pixel offset mode for draw operations
Public propertyPixelsPerPoint
Gets the scale of points to pixels. Multiply by point value to get pixel size
Public propertyPointsPerPixel
Gets the scale of points per pixel. Multiply by pixel size to get point value (e.g. to set font size in pixels).
Top
Methods
  NameDescription
Public methodClear(Color)
Resets all pixels in the ClipBounds region with the specified color
Public methodClear(SolidBrush)
Resets all pixels in the ClipBounds region with the specified brush
Public methodDrawArc(Color, RectangleF, Single, Single)
Draws a 1 pixel wide arc with the specified color
Public methodDrawArc(Pen, RectangleF, Single, Single)
Draws an arc with the specified pen
Public methodDrawArc(Color, Single, Single, Single, Single, Single, Single)
Draws a 1 pixel wide arc with the specified color
Public methodDrawArc(Pen, Single, Single, Single, Single, Single, Single)
Draws an arc with the specified pen
Public methodDrawEllipse(Color, RectangleF)
Draws a 1 pixel wide ellipse outline with the specified color
Public methodDrawEllipse(Pen, RectangleF)
Draws an ellipse outline with the specified pen
Public methodDrawEllipse(Color, Single, Single, Single, Single)
Draws a 1 pixel wide ellipse outline with the specified color
Public methodDrawEllipse(Pen, Single, Single, Single, Single)
Draws an ellipse with the specified pen
Public methodDrawImage(Image, PointF)
Draws the specified image at a location with no scaling
Public methodDrawImage(Image, RectangleF)
Draws the specified image in a rectangle
Public methodDrawImage(Image, RectangleF, PointF)
Draws the source portion of an image, scaling to the specified destination
Public methodDrawImage(Image, RectangleF, RectangleF)
Draws the source portion of an image, scaling to the specified destination
Public methodDrawImage(Image, Single, Single)
Draws the specified image at a location with no scaling
Public methodDrawImage(Image, Single, Single, Single, Single)
Draws the specified image in a rectangle
Public methodDrawInsetRectangle
Draws an rectangle with colors on the top/left and bottom/right with the given width
Public methodDrawLine(Color, PointF, PointF)
Draws a 1 pixel wide line with the specified color
Public methodDrawLine(Pen, PointF, PointF)
Draws a line with the specified pen
Public methodDrawLine(Color, Single, Single, Single, Single)
Draws a 1 pixel wide line with the specified color
Public methodDrawLine(Pen, Single, Single, Single, Single)
Draws a line with the specified pen
Public methodDrawLines(Color, PointF)
Draws a 1 pixel wide set of lines with the specified points
Public methodDrawLines(Color, IEnumerablePointF)
Draws a 1 pixel wide set of lines with the specified points
Public methodDrawLines(Pen, PointF)
Draws a set of lines with the specified points
Public methodDrawLines(Pen, IEnumerablePointF)
Draws a set of lines with the specified points
Public methodDrawPath(Color, IGraphicsPath)
Draws a 1 pixel outline of the specified path
Public methodDrawPath(Pen, IGraphicsPath)
Draws the specified path
Public methodDrawPolygon(Color, PointF)
Draws a 1 pixel wide outline of a polygon with the specified points
Public methodDrawPolygon(Pen, PointF)
Draws an outline of a polygon with the specified points
Public methodDrawRectangle(Color, RectangleF)
Draws a 1 pixel wide outline of a rectangle with the specified color
Public methodDrawRectangle(Pen, RectangleF)
Draws a rectangle
Public methodDrawRectangle(Color, Single, Single, Single, Single)
Draws a 1 pixel wide outline of a rectangle with the specified color
Public methodDrawRectangle(Pen, Single, Single, Single, Single)
Draws a rectangle
Public methodDrawText(FormattedText, PointF)
Draws formatted text at the specified location
Public methodDrawText(Font, Brush, PointF, String)
Draws text with the specified font, brush and location
Public methodDrawText(Font, Color, PointF, String)
Draws text with the specified font, color and location
Public methodDrawText(Font, SolidBrush, PointF, String)
Draws text with the specified font, brush and location
Public methodDrawText(Font, Brush, Single, Single, String)
Draws text with the specified font, brush and location
Public methodDrawText(Font, Color, Single, Single, String)
Draws text with the specified font, color and location
Public methodDrawText(Font, SolidBrush, Single, Single, String)
Draws text with the specified font, brush and location
Public methodDrawText(Font, Brush, RectangleF, String, FormattedTextWrapMode, FormattedTextAlignment, FormattedTextTrimming)
Draws text in a rectangle with the specified formatted text trimming
Public methodFillEllipse(Brush, RectangleF)
Fills an ellipse with the specified brush
Public methodFillEllipse(Color, RectangleF)
Fills an ellipse with the specified color
Public methodFillEllipse(Brush, Single, Single, Single, Single)
Fills an ellipse with the specified brush
Public methodFillEllipse(Color, Single, Single, Single, Single)
Fills an ellipse with the specified color
Public methodFillPath(Brush, IGraphicsPath)
Fills the specified path
Public methodFillPath(Color, IGraphicsPath)
Fills the specified path
Public methodFillPie(Brush, RectangleF, Single, Single)
Fills a pie with the specified brush
Public methodFillPie(Color, RectangleF, Single, Single)
Fills a pie with the specified color
Public methodFillPie(Brush, Single, Single, Single, Single, Single, Single)
Fills a pie with the specified brush
Public methodFillPie(Color, Single, Single, Single, Single, Single, Single)
Fills a pie with the specified color
Public methodFillPolygon(Brush, PointF)
Fills a polygon defined by points with the specified brush
Public methodFillPolygon(Color, PointF)
Fills a polygon defined by points with the specified color
Public methodFillRectangle(Brush, RectangleF)
Fills a rectangle with the specified brush
Public methodFillRectangle(Color, RectangleF)
Fills a rectangle with the specified color
Public methodFillRectangle(Brush, Single, Single, Single, Single)
Fills a rectangle with the specified brush
Public methodFillRectangle(Color, Single, Single, Single, Single)
Fills a rectangle with the specified color
Public methodFillRectangles(Brush, IEnumerableRectangleF)
Fills the specified rectangles
Public methodFillRectangles(Color, IEnumerableRectangleF)
Fills the specified rectangles
Public methodFlush
Flushes the drawing (for some platforms)
Public methodIsVisible
Returns true if the clip region intersects the specified rectangle.
Public methodMeasureString
Measures the string with the given font
Public methodMultiplyTransform
Multiplies the co-ordinate system with the given matrix
Public methodResetClip
Resets the clip bounds to encompass the entire drawing area
Public methodRestoreTransform
Restores the transform state
Public methodRotateTransform
Rotates the co-ordinate system by the given angle
Public methodSaveTransform
Saves the current transform state
Public methodCode exampleSaveTransformState
Gets an object that will restore to the current transform state when disposed.
Public methodScaleTransform(Single)
Scales the co-ordinate system by a factor
Public methodScaleTransform(SizeF)
Scales the co-ordinate system by a factor
Public methodScaleTransform(Single, Single)
Scales the co-ordinate system by a factor
Public methodSetClip(IGraphicsPath)
Sets the clip region to the specified path
Public methodSetClip(RectangleF)
Sets the clip region to the specified rectangle
Public methodTranslateTransform(PointF)
Translates the origin of the co-ordinate system by the given offset
Public methodTranslateTransform(Single, Single)
Translates the origin of the co-ordinate system by the given offset
Top
Remarks
This class allows you to draw on either a Bitmap or a Drawable control.
See Also