Graphics Class

Graphics Class

 

Encapsulates a GDI+ drawing surface. This class cannot be inherited.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

System.Object
  System.MarshalByRefObject
    System.Drawing.Graphics

public sealed class Graphics : MarshalByRefObject, IDisposable, 
	IDeviceContext

NameDescription
System_CAPS_pubpropertyClip

Gets or sets a Region that limits the drawing region of this Graphics.

System_CAPS_pubpropertyClipBounds

Gets a RectangleF structure that bounds the clipping region of this Graphics.

System_CAPS_pubpropertyCompositingMode

Gets a value that specifies how composited images are drawn to this Graphics.

System_CAPS_pubpropertyCompositingQuality

Gets or sets the rendering quality of composited images drawn to this Graphics.

System_CAPS_pubpropertyDpiX

Gets the horizontal resolution of this Graphics.

System_CAPS_pubpropertyDpiY

Gets the vertical resolution of this Graphics.

System_CAPS_pubpropertyInterpolationMode

Gets or sets the interpolation mode associated with this Graphics.

System_CAPS_pubpropertyIsClipEmpty

Gets a value indicating whether the clipping region of this Graphics is empty.

System_CAPS_pubpropertyIsVisibleClipEmpty

Gets a value indicating whether the visible clipping region of this Graphics is empty.

System_CAPS_pubpropertyPageScale

Gets or sets the scaling between world units and page units for this Graphics.

System_CAPS_pubpropertyPageUnit

Gets or sets the unit of measure used for page coordinates in this Graphics.

System_CAPS_pubpropertyPixelOffsetMode

Gets or set a value specifying how pixels are offset during rendering of this Graphics.

System_CAPS_pubpropertyRenderingOrigin

Gets or sets the rendering origin of this Graphics for dithering and for hatch brushes.

System_CAPS_pubpropertySmoothingMode

Gets or sets the rendering quality for this Graphics.

System_CAPS_pubpropertyTextContrast

Gets or sets the gamma correction value for rendering text.

System_CAPS_pubpropertyTextRenderingHint

Gets or sets the rendering mode for text associated with this Graphics.

System_CAPS_pubpropertyTransform

Gets or sets a copy of the geometric world transformation for this Graphics.

System_CAPS_pubpropertyVisibleClipBounds

Gets the bounding rectangle of the visible clipping region of this Graphics.

NameDescription
System_CAPS_pubmethodAddMetafileComment(Byte[])

Adds a comment to the current Metafile.

System_CAPS_pubmethodBeginContainer()

Saves a graphics container with the current state of this Graphics and opens and uses a new graphics container.

System_CAPS_pubmethodBeginContainer(Rectangle, Rectangle, GraphicsUnit)

Saves a graphics container with the current state of this Graphics and opens and uses a new graphics container with the specified scale transformation.

System_CAPS_pubmethodBeginContainer(RectangleF, RectangleF, GraphicsUnit)

Saves a graphics container with the current state of this Graphics and opens and uses a new graphics container with the specified scale transformation.

System_CAPS_pubmethodClear(Color)

Clears the entire drawing surface and fills it with the specified background color.

System_CAPS_pubmethodCopyFromScreen(Int32, Int32, Int32, Int32, Size)

Performs a bit-block transfer of the color data, corresponding to a rectangle of pixels, from the screen to the drawing surface of the Graphics.

System_CAPS_pubmethodCopyFromScreen(Int32, Int32, Int32, Int32, Size, CopyPixelOperation)

Performs a bit-block transfer of the color data, corresponding to a rectangle of pixels, from the screen to the drawing surface of the Graphics.

System_CAPS_pubmethodCopyFromScreen(Point, Point, Size)

Performs a bit-block transfer of color data, corresponding to a rectangle of pixels, from the screen to the drawing surface of the Graphics.

System_CAPS_pubmethodCopyFromScreen(Point, Point, Size, CopyPixelOperation)

Performs a bit-block transfer of color data, corresponding to a rectangle of pixels, from the screen to the drawing surface of the Graphics.

System_CAPS_pubmethodCreateObjRef(Type)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodDispose()

Releases all resources used by this Graphics.

System_CAPS_pubmethodDrawArc(Pen, Int32, Int32, Int32, Int32, Int32, Int32)

Draws an arc representing a portion of an ellipse specified by a pair of coordinates, a width, and a height.

System_CAPS_pubmethodDrawArc(Pen, Rectangle, Single, Single)

Draws an arc representing a portion of an ellipse specified by a Rectangle structure.

System_CAPS_pubmethodDrawArc(Pen, RectangleF, Single, Single)

Draws an arc representing a portion of an ellipse specified by a RectangleF structure.

System_CAPS_pubmethodDrawArc(Pen, Single, Single, Single, Single, Single, Single)

Draws an arc representing a portion of an ellipse specified by a pair of coordinates, a width, and a height.

System_CAPS_pubmethodDrawBezier(Pen, Point, Point, Point, Point)

Draws a Bézier spline defined by four Point structures.

System_CAPS_pubmethodDrawBezier(Pen, PointF, PointF, PointF, PointF)

Draws a Bézier spline defined by four PointF structures.

System_CAPS_pubmethodDrawBezier(Pen, Single, Single, Single, Single, Single, Single, Single, Single)

Draws a Bézier spline defined by four ordered pairs of coordinates that represent points.

System_CAPS_pubmethodDrawBeziers(Pen, Point[])

Draws a series of Bézier splines from an array of Point structures.

System_CAPS_pubmethodDrawBeziers(Pen, PointF[])

Draws a series of Bézier splines from an array of PointF structures.

System_CAPS_pubmethodDrawClosedCurve(Pen, Point[])

Draws a closed cardinal spline defined by an array of Point structures.

System_CAPS_pubmethodDrawClosedCurve(Pen, Point[], Single, FillMode)

Draws a closed cardinal spline defined by an array of Point structures using a specified tension.

System_CAPS_pubmethodDrawClosedCurve(Pen, PointF[])

Draws a closed cardinal spline defined by an array of PointF structures.

System_CAPS_pubmethodDrawClosedCurve(Pen, PointF[], Single, FillMode)

Draws a closed cardinal spline defined by an array of PointF structures using a specified tension.

System_CAPS_pubmethodDrawCurve(Pen, Point[])

Draws a cardinal spline through a specified array of Point structures.

System_CAPS_pubmethodDrawCurve(Pen, Point[], Int32, Int32, Single)

Draws a cardinal spline through a specified array of Point structures using a specified tension.

System_CAPS_pubmethodDrawCurve(Pen, Point[], Single)

Draws a cardinal spline through a specified array of Point structures using a specified tension.

System_CAPS_pubmethodDrawCurve(Pen, PointF[])

Draws a cardinal spline through a specified array of PointF structures.

System_CAPS_pubmethodDrawCurve(Pen, PointF[], Int32, Int32)

Draws a cardinal spline through a specified array of PointF structures. The drawing begins offset from the beginning of the array.

System_CAPS_pubmethodDrawCurve(Pen, PointF[], Int32, Int32, Single)

Draws a cardinal spline through a specified array of PointF structures using a specified tension. The drawing begins offset from the beginning of the array.

System_CAPS_pubmethodDrawCurve(Pen, PointF[], Single)

Draws a cardinal spline through a specified array of PointF structures using a specified tension.

System_CAPS_pubmethodDrawEllipse(Pen, Int32, Int32, Int32, Int32)

Draws an ellipse defined by a bounding rectangle specified by coordinates for the upper-left corner of the rectangle, a height, and a width.

System_CAPS_pubmethodDrawEllipse(Pen, Rectangle)

Draws an ellipse specified by a bounding Rectangle structure.

System_CAPS_pubmethodDrawEllipse(Pen, RectangleF)

Draws an ellipse defined by a bounding RectangleF.

System_CAPS_pubmethodDrawEllipse(Pen, Single, Single, Single, Single)

Draws an ellipse defined by a bounding rectangle specified by a pair of coordinates, a height, and a width.

System_CAPS_pubmethodDrawIcon(Icon, Int32, Int32)

Draws the image represented by the specified Icon at the specified coordinates.

System_CAPS_pubmethodDrawIcon(Icon, Rectangle)

Draws the image represented by the specified Icon within the area specified by a Rectangle structure.

System_CAPS_pubmethodDrawIconUnstretched(Icon, Rectangle)

Draws the image represented by the specified Icon without scaling the image.

System_CAPS_pubmethodDrawImage(Image, Int32, Int32)

Draws the specified image, using its original physical size, at the location specified by a coordinate pair.

System_CAPS_pubmethodDrawImage(Image, Int32, Int32, Int32, Int32)

Draws the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Int32, Int32, Rectangle, GraphicsUnit)

Draws a portion of an image at a specified location.

System_CAPS_pubmethodDrawImage(Image, Point)

Draws the specified Image, using its original physical size, at the specified location.

System_CAPS_pubmethodDrawImage(Image, Point[])

Draws the specified Image at the specified location and with the specified shape and size.

System_CAPS_pubmethodDrawImage(Image, Point[], Rectangle, GraphicsUnit)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Point[], Rectangle, GraphicsUnit, ImageAttributes)

Draws the specified portion of the specified Image at the specified location.

System_CAPS_pubmethodDrawImage(Image, Point[], Rectangle, GraphicsUnit, ImageAttributes, Graphics.DrawImageAbort)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Point[], Rectangle, GraphicsUnit, ImageAttributes, Graphics.DrawImageAbort, Int32)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, PointF)

Draws the specified Image, using its original physical size, at the specified location.

System_CAPS_pubmethodDrawImage(Image, PointF[])

Draws the specified Image at the specified location and with the specified shape and size.

System_CAPS_pubmethodDrawImage(Image, PointF[], RectangleF, GraphicsUnit)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, PointF[], RectangleF, GraphicsUnit, ImageAttributes)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, PointF[], RectangleF, GraphicsUnit, ImageAttributes, Graphics.DrawImageAbort)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, PointF[], RectangleF, GraphicsUnit, ImageAttributes, Graphics.DrawImageAbort, Int32)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle)

Draws the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle, Int32, Int32, Int32, Int32, GraphicsUnit)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle, Int32, Int32, Int32, Int32, GraphicsUnit, ImageAttributes)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle, Int32, Int32, Int32, Int32, GraphicsUnit, ImageAttributes, Graphics.DrawImageAbort)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle, Int32, Int32, Int32, Int32, GraphicsUnit, ImageAttributes, Graphics.DrawImageAbort, IntPtr)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle, Rectangle, GraphicsUnit)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle, Single, Single, Single, Single, GraphicsUnit)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle, Single, Single, Single, Single, GraphicsUnit, ImageAttributes)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle, Single, Single, Single, Single, GraphicsUnit, ImageAttributes, Graphics.DrawImageAbort)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Rectangle, Single, Single, Single, Single, GraphicsUnit, ImageAttributes, Graphics.DrawImageAbort, IntPtr)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, RectangleF)

Draws the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, RectangleF, RectangleF, GraphicsUnit)

Draws the specified portion of the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImage(Image, Single, Single)

Draws the specified Image, using its original physical size, at the specified location.

System_CAPS_pubmethodDrawImage(Image, Single, Single, RectangleF, GraphicsUnit)

Draws a portion of an image at a specified location.

System_CAPS_pubmethodDrawImage(Image, Single, Single, Single, Single)

Draws the specified Image at the specified location and with the specified size.

System_CAPS_pubmethodDrawImageUnscaled(Image, Int32, Int32)

Draws the specified image using its original physical size at the location specified by a coordinate pair.

System_CAPS_pubmethodDrawImageUnscaled(Image, Int32, Int32, Int32, Int32)

Draws a specified image using its original physical size at a specified location.

System_CAPS_pubmethodDrawImageUnscaled(Image, Point)

Draws a specified image using its original physical size at a specified location.

System_CAPS_pubmethodDrawImageUnscaled(Image, Rectangle)

Draws a specified image using its original physical size at a specified location.

System_CAPS_pubmethodDrawImageUnscaledAndClipped(Image, Rectangle)

Draws the specified image without scaling and clips it, if necessary, to fit in the specified rectangle.

System_CAPS_pubmethodDrawLine(Pen, Int32, Int32, Int32, Int32)

Draws a line connecting the two points specified by the coordinate pairs.

System_CAPS_pubmethodDrawLine(Pen, Point, Point)

Draws a line connecting two Point structures.

System_CAPS_pubmethodDrawLine(Pen, PointF, PointF)

Draws a line connecting two PointF structures.

System_CAPS_pubmethodDrawLine(Pen, Single, Single, Single, Single)

Draws a line connecting the two points specified by the coordinate pairs.

System_CAPS_pubmethodDrawLines(Pen, Point[])

Draws a series of line segments that connect an array of Point structures.

System_CAPS_pubmethodDrawLines(Pen, PointF[])

Draws a series of line segments that connect an array of PointF structures.

System_CAPS_pubmethodDrawPath(Pen, GraphicsPath)

Draws a GraphicsPath.

System_CAPS_pubmethodDrawPie(Pen, Int32, Int32, Int32, Int32, Int32, Int32)

Draws a pie shape defined by an ellipse specified by a coordinate pair, a width, a height, and two radial lines.

System_CAPS_pubmethodDrawPie(Pen, Rectangle, Single, Single)

Draws a pie shape defined by an ellipse specified by a Rectangle structure and two radial lines.

System_CAPS_pubmethodDrawPie(Pen, RectangleF, Single, Single)

Draws a pie shape defined by an ellipse specified by a RectangleF structure and two radial lines.

System_CAPS_pubmethodDrawPie(Pen, Single, Single, Single, Single, Single, Single)

Draws a pie shape defined by an ellipse specified by a coordinate pair, a width, a height, and two radial lines.

System_CAPS_pubmethodDrawPolygon(Pen, Point[])

Draws a polygon defined by an array of Point structures.

System_CAPS_pubmethodDrawPolygon(Pen, PointF[])

Draws a polygon defined by an array of PointF structures.

System_CAPS_pubmethodDrawRectangle(Pen, Int32, Int32, Int32, Int32)

Draws a rectangle specified by a coordinate pair, a width, and a height.

System_CAPS_pubmethodDrawRectangle(Pen, Rectangle)

Draws a rectangle specified by a Rectangle structure.

System_CAPS_pubmethodDrawRectangle(Pen, Single, Single, Single, Single)

Draws a rectangle specified by a coordinate pair, a width, and a height.

System_CAPS_pubmethodDrawRectangles(Pen, Rectangle[])

Draws a series of rectangles specified by Rectangle structures.

System_CAPS_pubmethodDrawRectangles(Pen, RectangleF[])

Draws a series of rectangles specified by RectangleF structures.

System_CAPS_pubmethodDrawString(String, Font, Brush, PointF)

Draws the specified text string at the specified location with the specified Brush and Font objects.

System_CAPS_pubmethodDrawString(String, Font, Brush, PointF, StringFormat)

Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting attributes of the specified StringFormat.

System_CAPS_pubmethodDrawString(String, Font, Brush, RectangleF)

Draws the specified text string in the specified rectangle with the specified Brush and Font objects.

System_CAPS_pubmethodDrawString(String, Font, Brush, RectangleF, StringFormat)

Draws the specified text string in the specified rectangle with the specified Brush and Font objects using the formatting attributes of the specified StringFormat.

System_CAPS_pubmethodDrawString(String, Font, Brush, Single, Single)

Draws the specified text string at the specified location with the specified Brush and Font objects.

System_CAPS_pubmethodDrawString(String, Font, Brush, Single, Single, StringFormat)

Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting attributes of the specified StringFormat.

System_CAPS_pubmethodEndContainer(GraphicsContainer)

Closes the current graphics container and restores the state of this Graphics to the state saved by a call to the BeginContainer method.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point, Graphics.EnumerateMetafileProc)

Sends the records in the specified Metafile, one at a time, to a callback method for display at a specified point.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records in the specified Metafile, one at a time, to a callback method for display at a specified point.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records in the specified Metafile, one at a time, to a callback method for display at a specified point using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point, Rectangle, GraphicsUnit, Graphics.EnumerateMetafileProc)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display at a specified point.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point, Rectangle, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display at a specified point.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point, Rectangle, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display at a specified point using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point[], Graphics.EnumerateMetafileProc)

Sends the records in the specified Metafile, one at a time, to a callback method for display in a specified parallelogram.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point[], Graphics.EnumerateMetafileProc, IntPtr)

Sends the records in the specified Metafile, one at a time, to a callback method for display in a specified parallelogram.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point[], Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records in the specified Metafile, one at a time, to a callback method for display in a specified parallelogram using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point[], Rectangle, GraphicsUnit, Graphics.EnumerateMetafileProc)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified parallelogram.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point[], Rectangle, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified parallelogram.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Point[], Rectangle, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified parallelogram using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF, Graphics.EnumerateMetafileProc)

Sends the records in the specified Metafile, one at a time, to a callback method for display at a specified point.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records in the specified Metafile, one at a time, to a callback method for display at a specified point.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records in the specified Metafile, one at a time, to a callback method for display at a specified point using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF, RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display at a specified point.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF, RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display at a specified point.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF, RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display at a specified point using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF[], Graphics.EnumerateMetafileProc)

Sends the records in the specified Metafile, one at a time, to a callback method for display in a specified parallelogram.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF[], Graphics.EnumerateMetafileProc, IntPtr)

Sends the records in the specified Metafile, one at a time, to a callback method for display in a specified parallelogram.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF[], Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records in the specified Metafile, one at a time, to a callback method for display in a specified parallelogram using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF[], RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified parallelogram.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF[], RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified parallelogram.

System_CAPS_pubmethodEnumerateMetafile(Metafile, PointF[], RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records in a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified parallelogram using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Rectangle, Graphics.EnumerateMetafileProc)

Sends the records of the specified Metafile, one at a time, to a callback method for display in a specified rectangle.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Rectangle, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records of the specified Metafile, one at a time, to a callback method for display in a specified rectangle.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Rectangle, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records of the specified Metafile, one at a time, to a callback method for display in a specified rectangle using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Rectangle, Rectangle, GraphicsUnit, Graphics.EnumerateMetafileProc)

Sends the records of a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified rectangle.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Rectangle, Rectangle, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records of a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified rectangle.

System_CAPS_pubmethodEnumerateMetafile(Metafile, Rectangle, Rectangle, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records of a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified rectangle using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, RectangleF, Graphics.EnumerateMetafileProc)

Sends the records of the specified Metafile, one at a time, to a callback method for display in a specified rectangle.

System_CAPS_pubmethodEnumerateMetafile(Metafile, RectangleF, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records of the specified Metafile, one at a time, to a callback method for display in a specified rectangle.

System_CAPS_pubmethodEnumerateMetafile(Metafile, RectangleF, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records of the specified Metafile, one at a time, to a callback method for display in a specified rectangle using specified image attributes.

System_CAPS_pubmethodEnumerateMetafile(Metafile, RectangleF, RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc)

Sends the records of a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified rectangle.

System_CAPS_pubmethodEnumerateMetafile(Metafile, RectangleF, RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr)

Sends the records of a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified rectangle.

System_CAPS_pubmethodEnumerateMetafile(Metafile, RectangleF, RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc, IntPtr, ImageAttributes)

Sends the records of a selected rectangle from a Metafile, one at a time, to a callback method for display in a specified rectangle using specified image attributes.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodExcludeClip(Rectangle)

Updates the clip region of this Graphics to exclude the area specified by a Rectangle structure.

System_CAPS_pubmethodExcludeClip(Region)

Updates the clip region of this Graphics to exclude the area specified by a Region.

System_CAPS_pubmethodFillClosedCurve(Brush, Point[])

Fills the interior of a closed cardinal spline curve defined by an array of Point structures.

System_CAPS_pubmethodFillClosedCurve(Brush, Point[], FillMode)

Fills the interior of a closed cardinal spline curve defined by an array of Point structures using the specified fill mode.

System_CAPS_pubmethodFillClosedCurve(Brush, Point[], FillMode, Single)

Fills the interior of a closed cardinal spline curve defined by an array of Point structures using the specified fill mode and tension.

System_CAPS_pubmethodFillClosedCurve(Brush, PointF[])

Fills the interior of a closed cardinal spline curve defined by an array of PointF structures.

System_CAPS_pubmethodFillClosedCurve(Brush, PointF[], FillMode)

Fills the interior of a closed cardinal spline curve defined by an array of PointF structures using the specified fill mode.

System_CAPS_pubmethodFillClosedCurve(Brush, PointF[], FillMode, Single)

Fills the interior of a closed cardinal spline curve defined by an array of PointF structures using the specified fill mode and tension.

System_CAPS_pubmethodFillEllipse(Brush, Int32, Int32, Int32, Int32)

Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.

System_CAPS_pubmethodFillEllipse(Brush, Rectangle)

Fills the interior of an ellipse defined by a bounding rectangle specified by a Rectangle structure.

System_CAPS_pubmethodFillEllipse(Brush, RectangleF)

Fills the interior of an ellipse defined by a bounding rectangle specified by a RectangleF structure.

System_CAPS_pubmethodFillEllipse(Brush, Single, Single, Single, Single)

Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.

System_CAPS_pubmethodFillPath(Brush, GraphicsPath)

Fills the interior of a GraphicsPath.

System_CAPS_pubmethodFillPie(Brush, Int32, Int32, Int32, Int32, Int32, Int32)

Fills the interior of a pie section defined by an ellipse specified by a pair of coordinates, a width, a height, and two radial lines.

System_CAPS_pubmethodFillPie(Brush, Rectangle, Single, Single)

Fills the interior of a pie section defined by an ellipse specified by a RectangleF structure and two radial lines.

System_CAPS_pubmethodFillPie(Brush, Single, Single, Single, Single, Single, Single)

Fills the interior of a pie section defined by an ellipse specified by a pair of coordinates, a width, a height, and two radial lines.

System_CAPS_pubmethodFillPolygon(Brush, Point[])

Fills the interior of a polygon defined by an array of points specified by Point structures.

System_CAPS_pubmethodFillPolygon(Brush, Point[], FillMode)

Fills the interior of a polygon defined by an array of points specified by Point structures using the specified fill mode.

System_CAPS_pubmethodFillPolygon(Brush, PointF[])

Fills the interior of a polygon defined by an array of points specified by PointF structures.

System_CAPS_pubmethodFillPolygon(Brush, PointF[], FillMode)

Fills the interior of a polygon defined by an array of points specified by PointF structures using the specified fill mode.

System_CAPS_pubmethodFillRectangle(Brush, Int32, Int32, Int32, Int32)

Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.

System_CAPS_pubmethodFillRectangle(Brush, Rectangle)

Fills the interior of a rectangle specified by a Rectangle structure.

System_CAPS_pubmethodFillRectangle(Brush, RectangleF)

Fills the interior of a rectangle specified by a RectangleF structure.

System_CAPS_pubmethodFillRectangle(Brush, Single, Single, Single, Single)

Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.

System_CAPS_pubmethodFillRectangles(Brush, Rectangle[])

Fills the interiors of a series of rectangles specified by Rectangle structures.

System_CAPS_pubmethodFillRectangles(Brush, RectangleF[])

Fills the interiors of a series of rectangles specified by RectangleF structures.

System_CAPS_pubmethodFillRegion(Brush, Region)

Fills the interior of a Region.

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Overrides Object.Finalize().)

System_CAPS_pubmethodFlush()

Forces execution of all pending graphics operations and returns immediately without waiting for the operations to finish.

System_CAPS_pubmethodFlush(FlushIntention)

Forces execution of all pending graphics operations with the method waiting or not waiting, as specified, to return before the operations finish.

System_CAPS_pubmethodSystem_CAPS_staticFromHdc(IntPtr)

Creates a new Graphics from the specified handle to a device context.

System_CAPS_pubmethodSystem_CAPS_staticFromHdc(IntPtr, IntPtr)

Creates a new Graphics from the specified handle to a device context and handle to a device.

System_CAPS_pubmethodSystem_CAPS_staticFromHdcInternal(IntPtr)

This API supports the product infrastructure and is not intended to be used directly from your code. Returns a Graphics for the specified device context.

System_CAPS_pubmethodSystem_CAPS_staticFromHwnd(IntPtr)

Creates a new Graphics from the specified handle to a window.

System_CAPS_pubmethodSystem_CAPS_staticFromHwndInternal(IntPtr)

This API supports the product infrastructure and is not intended to be used directly from your code. Creates a new Graphics for the specified windows handle.

System_CAPS_pubmethodSystem_CAPS_staticFromImage(Image)

Creates a new Graphics from the specified Image.

System_CAPS_pubmethodGetContextInfo()

This API supports the product infrastructure and is not intended to be used directly from your code. Gets the cumulative graphics context.

System_CAPS_pubmethodSystem_CAPS_staticGetHalftonePalette()

Gets a handle to the current Windows halftone palette.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetHdc()

Gets the handle to the device context associated with this Graphics.

System_CAPS_pubmethodGetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodGetNearestColor(Color)

Gets the nearest color to the specified Color structure.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodInitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodIntersectClip(Rectangle)

Updates the clip region of this Graphics to the intersection of the current clip region and the specified Rectangle structure.

System_CAPS_pubmethodIntersectClip(RectangleF)

Updates the clip region of this Graphics to the intersection of the current clip region and the specified RectangleF structure.

System_CAPS_pubmethodIntersectClip(Region)

Updates the clip region of this Graphics to the intersection of the current clip region and the specified Region.

System_CAPS_pubmethodIsVisible(Int32, Int32)

Indicates whether the point specified by a pair of coordinates is contained within the visible clip region of this Graphics.

System_CAPS_pubmethodIsVisible(Int32, Int32, Int32, Int32)

Indicates whether the rectangle specified by a pair of coordinates, a width, and a height is contained within the visible clip region of this Graphics.

System_CAPS_pubmethodIsVisible(Point)

Indicates whether the specified Point structure is contained within the visible clip region of this Graphics.

System_CAPS_pubmethodIsVisible(PointF)

Indicates whether the specified PointF structure is contained within the visible clip region of this Graphics.

System_CAPS_pubmethodIsVisible(Rectangle)

Indicates whether the rectangle specified by a Rectangle structure is contained within the visible clip region of this Graphics.

System_CAPS_pubmethodIsVisible(RectangleF)

Indicates whether the rectangle specified by a RectangleFstructure is contained within the visible clip region of this Graphics.

System_CAPS_pubmethodIsVisible(Single, Single)

Indicates whether the point specified by a pair of coordinates is contained within the visible clip region of this Graphics.

System_CAPS_pubmethodIsVisible(Single, Single, Single, Single)

Indicates whether the rectangle specified by a pair of coordinates, a width, and a height is contained within the visible clip region of this Graphics.

System_CAPS_pubmethodMeasureCharacterRanges(String, Font, RectangleF, StringFormat)

Gets an array of Region objects, each of which bounds a range of character positions within the specified string.

System_CAPS_pubmethodMeasureString(String, Font)

Measures the specified string when drawn with the specified Font.

System_CAPS_pubmethodMeasureString(String, Font, Int32)

Measures the specified string when drawn with the specified Font.

System_CAPS_pubmethodMeasureString(String, Font, Int32, StringFormat)

Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.

System_CAPS_pubmethodMeasureString(String, Font, PointF, StringFormat)

Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.

System_CAPS_pubmethodMeasureString(String, Font, SizeF)

Measures the specified string when drawn with the specified Font within the specified layout area.

System_CAPS_pubmethodMeasureString(String, Font, SizeF, StringFormat)

Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.

System_CAPS_pubmethodMeasureString(String, Font, SizeF, StringFormat, Int32, Int32)

Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.

System_CAPS_pubmethodMultiplyTransform(Matrix)

Multiplies the world transformation of this Graphics and specified the Matrix.

System_CAPS_pubmethodMultiplyTransform(Matrix, MatrixOrder)

Multiplies the world transformation of this Graphics and specified the Matrix in the specified order.

System_CAPS_pubmethodReleaseHdc()

Releases a device context handle obtained by a previous call to the GetHdc method of this Graphics.

System_CAPS_pubmethodReleaseHdc(IntPtr)

Releases a device context handle obtained by a previous call to the GetHdc method of this Graphics.

System_CAPS_pubmethodReleaseHdcInternal(IntPtr)

This API supports the product infrastructure and is not intended to be used directly from your code. Releases a handle to a device context.

System_CAPS_pubmethodResetClip()

Resets the clip region of this Graphics to an infinite region.

System_CAPS_pubmethodResetTransform()

Resets the world transformation matrix of this Graphics to the identity matrix.

System_CAPS_pubmethodRestore(GraphicsState)

Restores the state of this Graphics to the state represented by a GraphicsState.

System_CAPS_pubmethodRotateTransform(Single)

Applies the specified rotation to the transformation matrix of this Graphics.

System_CAPS_pubmethodRotateTransform(Single, MatrixOrder)

Applies the specified rotation to the transformation matrix of this Graphics in the specified order.

System_CAPS_pubmethodSave()

Saves the current state of this Graphics and identifies the saved state with a GraphicsState.

System_CAPS_pubmethodScaleTransform(Single, Single)

Applies the specified scaling operation to the transformation matrix of this Graphics by prepending it to the object's transformation matrix.

System_CAPS_pubmethodScaleTransform(Single, Single, MatrixOrder)

Applies the specified scaling operation to the transformation matrix of this Graphics in the specified order.

System_CAPS_pubmethodSetClip(Graphics)

Sets the clipping region of this Graphics to the Clip property of the specified Graphics.

System_CAPS_pubmethodSetClip(Graphics, CombineMode)

Sets the clipping region of this Graphics to the result of the specified combining operation of the current clip region and the Clip property of the specified Graphics.

System_CAPS_pubmethodSetClip(GraphicsPath)

Sets the clipping region of this Graphics to the specified GraphicsPath.

System_CAPS_pubmethodSetClip(GraphicsPath, CombineMode)

Sets the clipping region of this Graphics to the result of the specified operation combining the current clip region and the specified GraphicsPath.

System_CAPS_pubmethodSetClip(Rectangle)

Sets the clipping region of this Graphics to the rectangle specified by a Rectangle structure.

System_CAPS_pubmethodSetClip(Rectangle, CombineMode)

Sets the clipping region of this Graphics to the result of the specified operation combining the current clip region and the rectangle specified by a Rectangle structure.

System_CAPS_pubmethodSetClip(RectangleF)

Sets the clipping region of this Graphics to the rectangle specified by a RectangleF structure.

System_CAPS_pubmethodSetClip(RectangleF, CombineMode)

Sets the clipping region of this Graphics to the result of the specified operation combining the current clip region and the rectangle specified by a RectangleF structure.

System_CAPS_pubmethodSetClip(Region, CombineMode)

Sets the clipping region of this Graphics to the result of the specified operation combining the current clip region and the specified Region.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodTransformPoints(CoordinateSpace, CoordinateSpace, Point[])

Transforms an array of points from one coordinate space to another using the current world and page transformations of this Graphics.

System_CAPS_pubmethodTransformPoints(CoordinateSpace, CoordinateSpace, PointF[])

Transforms an array of points from one coordinate space to another using the current world and page transformations of this Graphics.

System_CAPS_pubmethodTranslateClip(Int32, Int32)

Translates the clipping region of this Graphics by specified amounts in the horizontal and vertical directions.

System_CAPS_pubmethodTranslateClip(Single, Single)

Translates the clipping region of this Graphics by specified amounts in the horizontal and vertical directions.

System_CAPS_pubmethodTranslateTransform(Single, Single)

Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this Graphics.

System_CAPS_pubmethodTranslateTransform(Single, Single, MatrixOrder)

Changes the origin of the coordinate system by applying the specified translation to the transformation matrix of this Graphics in the specified order.

The Graphics class provides methods for drawing objects to the display device. A Graphics is associated with a specific device context.

You can obtain a Graphics object by calling the Control.CreateGraphics method on an object that inherits from System.Windows.Forms.Control, or by handling a control's Control.Paint event and accessing the Graphics property of the System.Windows.Forms.PaintEventArgs class. You can also create a Graphics object from an image by using the FromImage method. For more information about creating a Graphics object, see How to: Create Graphics Objects for Drawing.

You can draw many different shapes and lines by using a Graphics object. For more information about how to draw lines and shapes, see the specific DrawGraphicalElement method for the line or shape you want to draw. These methods include DrawLine, DrawArc, DrawClosedCurve, DrawPolygon, and DrawRectangle. For more information about how to draw lines and shapes, see Using a Pen to Draw Lines and Shapes and Using a Brush to Fill Shapes.

You can also draw images and icons by using the DrawImage and DrawIcon methods, respectively. To perform a bit-block transfer of color data from the screen to the drawing surface of the Graphics object, see CopyFromScreen. For more information about how to draw images with a Graphics object, see Working with Images, Bitmaps, Icons, and Metafiles.

In addition, you can manipulate the coordinate system used by the Graphics object. For more information on the coordinate system and how to manipulate it, see Coordinate Systems and Transformations.

The following code example is designed for use with Windows Forms and requires a PaintEventArgs object. The PaintEventArgs object is named e and is a parameter of the Paint event handler. The code performs the following actions:

  • Creates an image from a JPEG file. The file is named SampImag.jpg and is located in the folder of the example.

  • Creates a point at which to draw the upper-left corner of the image.

  • Draws the unscaled image to the screen by using a Graphics object.

private void DrawImagePointF(PaintEventArgs e)
{

    // Create image.
    Image newImage = Image.FromFile("SampImag.jpg");

    // Create point for upper-left corner of image.
    PointF ulCorner = new PointF(100.0F, 100.0F);

    // Draw image to screen.
    e.Graphics.DrawImage(newImage, ulCorner);
}

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft