Graphics
Namespace: System.Drawing
Assembly: System.Drawing.Managed (4.0.0.0)
Encapsulates a GDI+ drawing surface.
- C#
- VB.NET
public class Graphics : MarshalByRefObject, IDisposable
Public Class Graphics
Inherits MarshalByRefObject
Implements IDisposable
Properties
Clip
Region: Gets or sets a Region that limits the drawing region of this Graphics.
ClipBounds
RectangleF: Gets a RectangleF structure that bounds the clipping region of this Graphics.
CompositingMode
CompositingMode: Gets or sets a value that specifies how composited images are drawn to this Graphics.
CompositingQuality
CompositingQuality: Gets or sets the rendering quality of composited images drawn to this Graphics.
DpiX
Single: Gets the horizontal resolution of this Graphics.
DpiY
Single: Gets the vertical resolution of this Graphics.
InterpolationMode
InterpolationMode: Gets or sets the interpolation mode associated with this Graphics.
IsClipEmpty
Boolean: Gets a value indicating whether the clipping region of this Graphics is empty.
PageScale
Single: Gets or sets the scaling between world units and page units for this Graphics.
PageUnit
GraphicsUnit: Gets or sets the unit of measure used for page coordinates in this Graphics.
PixelOffsetMode
PixelOffsetMode: Gets or sets a value specifying how pixels are offset during rendering of this Graphics.
RenderingOrigin
Point: Gets or sets the rendering origin of this Graphics for dithering and for hatch brushes.
SmoothingMode
SmoothingMode: Gets or sets the rendering quality for this Graphics.
TextContrast
Int32: Gets or sets the gamma correction value for rendering text.
TextRenderingHint
TextRenderingHint: Gets or sets the rendering mode for text associated with this Graphics.
Transform
Matrix: Gets or sets a copy of the geometric world transformation for this Graphics.
GDI+ uses three coordinate spaces: world, page, and device. World coordinates are the coordinates used to model a particular graphic world and are the coordinates you pass to methods in the .NET Framework. Page coordinates refer to the coordinate system used by a drawing surface, such as a form or a control. Device coordinates are the coordinates used by the physical device being drawn on, such as a screen or a printer. The Transform property represents the world transformation, which maps world coordinates to page coordinates. Because the matrix returned and by the Transform property is a copy of the geometric transform, you should dispose of the matrix when you no longer need it.
VisibleClipBounds
RectangleF: Gets the bounding rectangle of the visible clipping region of this Graphics.
Methods
BeginContainer()
Saves a graphics container with the current state of this Graphics and opens and uses a new graphics container.
Returns: GraphicsContainer. The GraphicsContainer.
BeginContainer(dstRect, srcRect, unit)
Saves a graphics container with the current state of this Graphics and opens and uses a new graphics container with the specified scale transformation.
| Parameter | Type | Description |
|---|---|---|
| dstRect | Rectangle | Rectangle structure that, together with the srcRect parameter, specifies a scale transformation for the container. |
| srcRect | Rectangle | Rectangle structure that, together with the dstRect parameter, specifies a scale transformation for the container. |
| unit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure for the dstRect |
Returns: GraphicsContainer. The GraphicsContainer.
BeginContainer(dstRect, srcRect, unit)
Saves a graphics container with the current state of this Graphics and opens and uses a new graphics container with the specified scale transformation.
| Parameter | Type | Description |
|---|---|---|
| dstRect | RectangleF | RectangleF structure that, together with the srcRect parameter, specifies a scale transformation for the container. |
| srcRect | RectangleF | RectangleF structure that, together with the dstRect parameter, specifies a scale transformation for the container. |
| unit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure for the dstRect |
Returns: GraphicsContainer. The GraphicsContainer.
Clear(color)
Clears the entire drawing surface and fills it with the specified background color.
| Parameter | Type | Description |
|---|---|---|
| color | Color | Color structure that represents the background color of the drawing surface. |
Dispose()
DrawArc(pen, x, y, width, height, startAngle, sweepAngle)
Draws an arc from the specified ellipse.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the arc. |
| x | Single | The x-coordinate of the upper-left corner of the rectangle that defines the ellipse. |
| y | Single | The y-coordinate of the upper-left corner of the rectangle that defines the ellipse. |
| width | Single | Width of the rectangle that defines the ellipse. |
| height | Single | Height of the rectangle that defines the ellipse. |
| startAngle | Single | Angle in degrees measured clockwise from the x-axis to the starting point of the arc. |
| sweepAngle | Single | Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc. |
DrawArc(pen, rect, startAngle, sweepAngle)
Draws an arc from the specified ellipse.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the arc. |
| rect | RectangleF | RectangleF structure that defines the boundaries of the ellipse. |
| startAngle | Single | Angle in degrees measured clockwise from the x-axis to the starting point of the arc. |
| sweepAngle | Single | Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc. |
DrawArc(pen, x, y, width, height, startAngle, sweepAngle)
Draws an arc from the specified ellipse.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the arc. |
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle that defines the ellipse. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle that defines the ellipse. |
| width | Int32 | Width of the rectangle that defines the ellipse. |
| height | Int32 | Height of the rectangle that defines the ellipse. |
| startAngle | Int32 | Angle in degrees measured clockwise from the x-axis to the starting point of the arc. |
| sweepAngle | Int32 | Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc. |
Throws:
- ArgumentNullException pen is .
DrawArc(pen, rect, startAngle, sweepAngle)
Draws an arc from the specified ellipse.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the arc. |
| rect | Rectangle | RectangleF structure that defines the boundaries of the ellipse. |
| startAngle | Single | Angle in degrees measured clockwise from the x-axis to the starting point of the arc. |
| sweepAngle | Single | Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc. |
DrawBezier(pen, x1, y1, x2, y2, x3, y3, x4, y4)
Draws a Bezier spline defined by four ordered pairs of coordinates that represent points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| x1 | Single | The x-coordinate of the starting point of the curve. |
| y1 | Single | The y-coordinate of the starting point of the curve. |
| x2 | Single | The x-coordinate of the first control point of the curve. |
| y2 | Single | The y-coordinate of the first control point of the curve. |
| x3 | Single | The x-coordinate of the second control point of the curve. |
| y3 | Single | The y-coordinate of the second control point of the curve. |
| x4 | Single | The x-coordinate of the ending point of the curve. |
| y4 | Single | The y-coordinate of the ending point of the curve. |
Throws:
- ArgumentNullException pen is .
DrawBezier(pen, pt1, pt2, pt3, pt4)
Draws a Bezier spline defined by four PointF structures.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| pt1 | PointF | PointF structure that represents the starting point of the curve. |
| pt2 | PointF | PointF structure that represents the first control point for the curve. |
| pt3 | PointF | PointF structure that represents the second control point for the curve. |
| pt4 | PointF | PointF structure that represents the ending point of the curve. |
DrawBezier(pen, pt1, pt2, pt3, pt4)
Draws a Bezier spline defined by four Point structures.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen structure that determines the color, width, and style of the curve. |
| pt1 | Point | Point structure that represents the starting point of the curve. |
| pt2 | Point | Point structure that represents the first control point for the curve. |
| pt3 | Point | Point structure that represents the second control point for the curve. |
| pt4 | Point | Point structure that represents the ending point of the curve. |
DrawBeziers(pen, points)
Draws a series of cubic Bezier curves from an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | PointF[] | Array of PointF structures that represent the points that determine the curve. The number of points in the array should be a multiple of 3 plus 1, such as 4, 7, or 10. |
DrawBeziers(pen, points)
Draws a series of cubic Bezier curves from an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | Point[] | Array of PointF structures that represent the points that determine the curve. The number of points in the array should be a multiple of 3 plus 1, such as 4, 7, or 10. |
DrawClosedCurve(pen, points)
Draws a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | PointF[] | Array of PointF structures that define the spline. |
DrawClosedCurve(pen, points, tension)
Draws a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | PointF[] | Array of PointF structures that define the spline. |
| tension | Single | Value greater than or equal to 0.0F that specifies the tension of the curve. |
DrawClosedCurve(pen, points)
Draws a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | Point[] | Array of Point structures that define the spline. |
DrawClosedCurve(pen, points, tension)
Draws a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | Point[] | Array of Point structures that define the spline. |
| tension | Single | Value greater than or equal to 0.0F that specifies the tension of the curve. |
DrawCurve(pen, points)
Draws a curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | PointF[] | An array of PointF structures that represents the points that define the curve. |
DrawCurve(pen, points, tension)
Draws a curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | PointF[] | An array of PointF structures that represents the points that define the curve. |
| tension | Single | A value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results. |
DrawCurve(pen, points, offset, numberOfSegments)
Draws a curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | PointF[] | An array of PointF structures that represents the points that define the curve. |
| offset | Int32 | The index of the element in the points array that is used as the first point in the curve. |
| numberOfSegments | Int32 | The number of segments used to draw the curve. A segment can be thought of as a line connecting two points. |
DrawCurve(pen, points, offset, numberOfSegments, tension)
Draws a curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | PointF[] | An array of PointF structures that represents the points that define the curve. |
| offset | Int32 | The index of the element in the points array that is used as the first point in the curve. |
| numberOfSegments | Int32 | The number of segments used to draw the curve. A segment can be thought of as a line connecting two points. |
| tension | Single | A value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results. |
DrawCurve(pen, points)
Draws a curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | Point[] | An array of Point structures that represents the points that define the curve. |
DrawCurve(pen, points, tension)
Draws a curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | Point[] | An array of Point structures that represents the points that define the curve. |
| tension | Single | A value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results. |
DrawCurve(pen, points, offset, numberOfSegments)
Draws a curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | Point[] | An array of PointF structures that represents the points that define the curve. |
| offset | Int32 | The index of the element in the points array that is used as the first point in the curve. |
| numberOfSegments | Int32 | The number of segments used to draw the curve. A segment can be thought of as a line connecting two points. |
DrawCurve(pen, points, offset, numberOfSegments, tension)
Draws a curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the curve. |
| points | Point[] | An array of Point structures that represents the points that define the curve. |
| offset | Int32 | The index of the element in the points array that is used as the first point in the curve. |
| numberOfSegments | Int32 | The number of segments used to draw the curve. A segment can be thought of as a line connecting two points. |
| tension | Single | A value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results. |
DrawEllipse(pen, rect)
Draws the outline of an ellipse defined by a bounding rectangle.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the ellipse. |
| rect | RectangleF | RectangleF structure that defines the boundaries of the ellipse. |
DrawEllipse(pen, x, y, width, height)
Draws the outline of an ellipse defined by a bounding rectangle.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the ellipse. |
| x | Single | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
| y | Single | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
| width | Single | Width of the bounding rectangle that defines the ellipse. |
| height | Single | Height of the bounding rectangle that defines the ellipse. |
DrawEllipse(pen, rect)
Draws the outline of an ellipse specified by a bounding Rectangle structure.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the ellipse. |
| rect | Rectangle | Rectangle structure that defines the boundaries of the ellipse. |
DrawEllipse(pen, x, y, width, height)
Draws the outline of an ellipse defined by a bounding rectangle specified by coordinates for the upper-left corner of the rectangle, a height, and a width.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the ellipse. |
| x | Int32 | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
| y | Int32 | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
| width | Int32 | Width of the bounding rectangle that defines the ellipse. |
| height | Int32 | Height of the bounding rectangle that defines the ellipse. |
DrawImage(image, point)
Draws the specified image at the specified location.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| point | PointF | Point structure that represents the location of the upper-left corner of the drawn image. |
Throws:
- ArgumentNullException image is .
DrawImage(image, x, y)
Draws the specified image, using its original physical size, at the location specified by a coordinate pair.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| x | Single | The x-coordinate of the upper-left corner of the drawn image. |
| y | Single | The y-coordinate of the upper-left corner of the drawn image. |
Throws:
- ArgumentNullException image is .
DrawImage(image, rect)
Draws the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| rect | RectangleF | Rectangle structure that specifies the location and size of the drawn image. |
Throws:
- ArgumentNullException image is .
DrawImage(image, x, y, width, height)
Draws the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| x | Single | The x-coordinate of the upper-left corner of the drawn image. |
| y | Single | The y-coordinate of the upper-left corner of the drawn image. |
| width | Single | Width of the drawn image. |
| height | Single | Height of the drawn image. |
Throws:
- ArgumentNullException image is .
DrawImage(image, point)
Draws the specified Image, using its original physical size, at the specified location.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| point | Point | Point structure that represents the location of the upper-left corner of the drawn image. |
Throws:
- ArgumentNullException image is .
DrawImage(image, x, y)
Draws the specified image, using its original physical size, at the location specified by a coordinate pair.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| x | Int32 | The x-coordinate of the upper-left corner of the drawn image. |
| y | Int32 | The y-coordinate of the upper-left corner of the drawn image. |
Throws:
- ArgumentNullException image is .
DrawImage(image, rect)
Draws the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| rect | Rectangle | Rectangle structure that specifies the location and size of the drawn image. |
Throws:
- ArgumentNullException image is .
DrawImage(image, x, y, width, height)
Draws the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| x | Int32 | The x-coordinate of the upper-left corner of the drawn image. |
| y | Int32 | The y-coordinate of the upper-left corner of the drawn image. |
| width | Int32 | Width of the drawn image. |
| height | Int32 | Height of the drawn image. |
Throws:
- ArgumentNullException image is .
DrawImage(image, destPoints)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destPoints | PointF[] | Array of three PointF structures that define a parallelogram. |
Throws:
- ArgumentNullException image is .
- ArgumentNullException destPoints is .
- ArgumentException The number of points is not 3 or 4.
DrawImage(image, destPoints)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destPoints | Point[] | Array of three PointF structures that define a parallelogram. |
Throws:
- ArgumentNullException image is .
- ArgumentNullException destPoints is .
- ArgumentException The number of points is not 3 or 4.
DrawImage(image, x, y, srcRect, srcUnit)
Draws a portion of an image at a specified location.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| x | Single | The x-coordinate of the upper-left corner of the drawn image. |
| y | Single | The y-coordinate of the upper-left corner of the drawn image. |
| srcRect | RectangleF | RectangleF structure that specifies the portion of the image object to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used by the srcRect parameter. |
Throws:
- ArgumentNullException image is .
DrawImage(image, x, y, srcRect, srcUnit)
Draws a portion of an image at a specified location.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| x | Int32 | The x-coordinate of the upper-left corner of the drawn image. |
| y | Int32 | The y-coordinate of the upper-left corner of the drawn image. |
| srcRect | Rectangle | RectangleF structure that specifies the portion of the image object to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used by the srcRect parameter. |
Throws:
- ArgumentNullException image is .
DrawImage(image, destRect, srcRect, srcUnit)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destRect | RectangleF | RectangleF structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
| srcRect | RectangleF | RectangleF structure that specifies the portion of the image object to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used by the srcRect parameter. |
Throws:
- ArgumentNullException image is .
DrawImage(image, destRect, srcRect, srcUnit)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destRect | Rectangle | Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
| srcRect | Rectangle | Rectangle structure that specifies the portion of the image object to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used by the srcRect parameter. |
Throws:
- ArgumentNullException image is .
DrawImage(image, destPoints, srcRect, srcUnit)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destPoints | PointF[] | Array of three PointF structures that define a parallelogram. |
| srcRect | RectangleF | Rectangle structure that specifies the portion of the image object to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle. |
Throws:
- ArgumentNullException image is .
DrawImage(image, destPoints, srcRect, srcUnit, imageAttr)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destPoints | PointF[] | Array of three PointF structures that define a parallelogram. |
| srcRect | RectangleF | Rectangle structure that specifies the portion of the image object to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle. |
| imageAttr | ImageAttributes | ImageAttributes that specifies recoloring and gamma information for the image object. |
Throws:
- ArgumentNullException image is .
DrawImage(image, destPoints, srcRect, srcUnit)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destPoints | Point[] | Array of three Point structures that define a parallelogram. |
| srcRect | Rectangle | Rectangle structure that specifies the portion of the image object to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle. |
Throws:
- ArgumentNullException image is .
- ArgumentNullException destPoints is .
- ArgumentException The number of points is not 3 or 4.
DrawImage(image, destPoints, srcRect, srcUnit, imageAttr)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destPoints | Point[] | Array of three Point structures that define a parallelogram. |
| srcRect | Rectangle | Rectangle structure that specifies the portion of the image object to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle. |
| imageAttr | ImageAttributes | ImageAttributes that specifies recoloring and gamma information for the image object. |
Throws:
- ArgumentNullException image is .
- ArgumentNullException destPoints is .
- ArgumentException The number of points is not 3 or 4.
DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destRect | Rectangle | Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
| srcX | Single | The x-coordinate of the upper-left corner of the portion of the source image to draw. |
| srcY | Single | The y-coordinate of the upper-left corner of the portion of the source image to draw. |
| srcWidth | Single | Width of the portion of the source image to draw. |
| srcHeight | Single | Height of the portion of the source image to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle. |
Throws:
- ArgumentNullException image is .
DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destRect | Rectangle | Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
| srcX | Single | The x-coordinate of the upper-left corner of the portion of the source image to draw. |
| srcY | Single | The y-coordinate of the upper-left corner of the portion of the source image to draw. |
| srcWidth | Single | Width of the portion of the source image to draw. |
| srcHeight | Single | Height of the portion of the source image to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle. |
| imageAttr | ImageAttributes | ImageAttributes that specifies recoloring and gamma information for the image object. |
Throws:
- ArgumentNullException image is .
DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destRect | Rectangle | Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
| srcX | Int32 | The x-coordinate of the upper-left corner of the portion of the source image to draw. |
| srcY | Int32 | The y-coordinate of the upper-left corner of the portion of the source image to draw. |
| srcWidth | Int32 | Width of the portion of the source image to draw. |
| srcHeight | Int32 | Height of the portion of the source image to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle. |
Throws:
- ArgumentNullException image is .
DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr)
Draws the specified portion of the specified Image at the specified location and with the specified size.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| destRect | Rectangle | Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
| srcX | Int32 | The x-coordinate of the upper-left corner of the portion of the source image to draw. |
| srcY | Int32 | The y-coordinate of the upper-left corner of the portion of the source image to draw. |
| srcWidth | Int32 | Width of the portion of the source image to draw. |
| srcHeight | Int32 | Height of the portion of the source image to draw. |
| srcUnit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle. |
| imageAttr | ImageAttributes | ImageAttributes that specifies recoloring and gamma information for the image object. |
Throws:
- ArgumentNullException image is .
DrawImageUnscaled(image, x, y)
Draws the specified image using its original physical size at the location specified by a coordinate pair.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| x | Int32 | The x-coordinate of the upper-left corner of the drawn image. |
| y | Int32 | The y-coordinate of the upper-left corner of the drawn image. |
Throws:
- ArgumentNullException image is
DrawImageUnscaled(image, x, y, width, height)
Draws a specified image using its original physical size at a specified location.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| x | Int32 | The x-coordinate of the upper-left corner of the drawn image. |
| y | Int32 | The y-coordinate of the upper-left corner of the drawn image. |
| width | Int32 | Not used. |
| height | Int32 | Not used |
Throws:
- ArgumentNullException image is
DrawImageUnscaled(image, point)
Draws a specified image using its original physical size at a specified location.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| point | Point | Point structure that specifies the upper-left corner of the drawn image. |
Throws:
- ArgumentNullException image is
DrawImageUnscaled(image, rect)
Draws a specified image using its original physical size at a specified location.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image to draw. |
| rect | Rectangle | Rectangle that specifies the upper-left corner of the drawn image. The X and Y properties of the rectangle specify the upper-left corner. The Width and Height properties are ignored. |
Throws:
- ArgumentNullException image is
DrawImageUnscaledAndClipped(image, rect)
Draws the specified image without scaling and clips it, if necessary, to fit in the specified rectangle.
| Parameter | Type | Description |
|---|---|---|
| image | Image | The Image to draw |
| rect | Rectangle | The Rectangle in which to draw the image. |
Throws:
- ArgumentException image is .
DrawLine(pen, x1, y1, x2, y2)
Draws a line connecting the two points specified by the coordinate pairs.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the line. |
| x1 | Int32 | The x-coordinate of the first point. |
| y1 | Int32 | The y-coordinate of the first point. |
| x2 | Int32 | The x-coordinate of the second point. |
| y2 | Int32 | The y-coordinate of the second point. |
Throws:
- ArgumentNullException pen is .
DrawLine(pen, x1, y1, x2, y2)
Draws a line connecting the two points specified by the coordinate pairs.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the line. |
| x1 | Single | The x-coordinate of the first point. |
| y1 | Single | The y-coordinate of the first point. |
| x2 | Single | The x-coordinate of the second point. |
| y2 | Single | The y-coordinate of the second point. |
Throws:
- ArgumentNullException pen is .
DrawLine(pen, pt1, pt2)
Draws a line connecting two PointF structures.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the line. |
| pt1 | Point | Point structure that represents the first point to connect. |
| pt2 | Point | Point structure that represents the second point to connect. |
DrawLine(pen, pt1, pt2)
Draws a line connecting two PointF structures.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the line. |
| pt1 | PointF | PointF structure that represents the first point to connect. |
| pt2 | PointF | PointF structure that represents the second point to connect. |
DrawLines(pen, points)
Draws a series of line segments that connect an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the line. |
| points | Point[] | Array of Point structures that represent the points to connect. |
DrawLines(pen, points)
Draws a series of line segments that connect an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the line. |
| points | PointF[] | Array of PointF structures that represent the points to connect. |
DrawPath(pen, path)
Draws a GraphicsPath.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the path. |
| path | GraphicsPath | GraphicsPath to draw. |
Throws:
- ArgumentNullException pen is . -or- path is .
DrawPie(pen, rect, startAngle, sweepAngle)
Draws the outline of a pie shape. The pie shape is a section of an ellipse. The ellipse is specified by a RectangleF structure. Two radial lines indicate the start and end of the pie slice.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the pie shape. |
| rect | RectangleF | RectangleF structure that represents the bounding rectangle that defines the ellipse from which the pie shape comes. |
| startAngle | Single | Angle measured in degrees clockwise from the x-axis to the first side of the pie shape. |
| sweepAngle | Single | Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape. |
DrawPie(pen, x, y, width, height, startAngle, sweepAngle)
Draws the outline of a pie shape. The pie shape is a section of an ellipse. The ellipse is specified by a coordinate pair, a width, and a height. Two radial lines indicate the start and end of the pie slice.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the pie shape. |
| x | Single | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes. |
| y | Single | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes. |
| width | Single | Width of the bounding rectangle that defines the ellipse from which the pie shape comes. |
| height | Single | Height of the bounding rectangle that defines the ellipse from which the pie shape comes. |
| startAngle | Single | Angle measured in degrees clockwise from the x-axis to the first side of the pie shape. |
| sweepAngle | Single | Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape. |
Throws:
- ArgumentNullException pen is .
DrawPie(pen, rect, startAngle, sweepAngle)
Draws the outline of a pie shape. The pie shape is a section of an ellipse. The ellipse is specified by a Rectangle structure. Two radial lines indicate the start and end of the pie slice.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the pie shape. |
| rect | Rectangle | Rectangle structure that represents the bounding rectangle that defines the ellipse from which the pie shape comes. |
| startAngle | Single | Angle measured in degrees clockwise from the x-axis to the first side of the pie shape. |
| sweepAngle | Single | Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape. |
DrawPie(pen, x, y, width, height, startAngle, sweepAngle)
Draws the outline of a pie shape. The pie shape is a section of an ellipse. The ellipse is specified by a coordinate pair, a width, and a height. Two radial lines indicate the start and end of the pie slice.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the pie shape. |
| x | Int32 | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes. |
| y | Int32 | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes. |
| width | Int32 | Width of the bounding rectangle that defines the ellipse from which the pie shape comes. |
| height | Int32 | Height of the bounding rectangle that defines the ellipse from which the pie shape comes. |
| startAngle | Int32 | Angle measured in degrees clockwise from the x-axis to the first side of the pie shape. |
| sweepAngle | Int32 | Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape. |
DrawPolygon(pen, points)
Draws the outline of a polygon defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the polygon. |
| points | PointF[] | Array of PointF points that represent the coordinates of the corners of the polygon |
DrawPolygon(pen, points)
Draws the outline of a polygon defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the polygon. |
| points | Point[] | Array of Point points that represent the coordinates of the corners of the polygon |
DrawRectangle(pen, rect)
Draws the outline of a RectangleF rectangle specified by rect .
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | A Pen that determines the color, width, and style of the rectangle. |
| rect | RectangleF | A RectangleF structure that represents the rectangle to draw. |
DrawRectangle(pen, rect)
Draws the outline of a Rectangle rectangle specified by rect .
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | A Pen that determines the color, width, and style of the rectangle. |
| rect | Rectangle | A Rectangle structure that represents the rectangle to draw. |
DrawRectangle(pen, x, y, width, height)
Draws a rectangle specified by a coordinate pair, a width, and a height.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | A Pen that determines the color, width, and style of the rectangle. |
| x | Single | The x-coordinate of the upper-left corner of the rectangle to draw. |
| y | Single | The y-coordinate of the upper-left corner of the rectangle to draw. |
| width | Single | The width of the rectangle to draw. |
| height | Single | The height of the rectangle to draw. |
DrawRectangle(pen, x, y, width, height)
Draws a rectangle specified by a coordinate pair, a width, and a height.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the rectangle. |
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle to draw. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle to draw. |
| width | Int32 | Width of the rectangle to draw. |
| height | Int32 | Height of the rectangle to draw. |
DrawRectangles(pen, rects)
Draws a series of rectangles specified by RectangleF structures.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the rectangles. |
| rects | RectangleF[] | Array of RectangleF structures that represent the rectangles to draw. |
DrawRectangles(pen, rects)
Draws a series of rectangles specified by Rectangle structures.
| Parameter | Type | Description |
|---|---|---|
| pen | Pen | Pen that determines the color, width, and style of the rectangles. |
| rects | Rectangle[] | Array of Rectangle structures that represent the rectangles to draw. |
DrawString(s, font, brush, x, y)
Draws the specified text string at the specified x and y coordinates with the specified Brush and Font objects.
| Parameter | Type | Description |
|---|---|---|
| s | String | String to draw. |
| font | Font | Font that defines the text format of the string. |
| brush | Brush | Brush that determines the color and texture of the drawn text. |
| x | Single | The x-coordinate of the upper-left corner of the drawn text. |
| y | Single | The y-coordinate of the upper-left corner of the drawn text. |
DrawString(s, font, brush, point)
Draws the specified text string at the specified location with the specified Brush and Font objects.
| Parameter | Type | Description |
|---|---|---|
| s | String | String to draw. |
| font | Font | Font that defines the text format of the string. |
| brush | Brush | Brush that determines the color and texture of the drawn text. |
| point | PointF | PointF structure that specifies the upper-left corner of the drawn text. |
DrawString(s, font, brush, x, y, format)
Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting attributes of the specified StringFormat.
| Parameter | Type | Description |
|---|---|---|
| s | String | String to draw. |
| font | Font | Font that defines the text format of the string. |
| brush | Brush | Brush that determines the color and texture of the drawn text. |
| x | Single | The x-coordinate of the upper-left corner of the drawn text. |
| y | Single | The y-coordinate of the upper-left corner of the drawn text. |
| format | StringFormat | StringFormat that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text. |
DrawString(s, font, brush, point, format)
Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting attributes of the specified StringFormat.
| Parameter | Type | Description |
|---|---|---|
| s | String | String to draw. |
| font | Font | Font that defines the text format of the string. |
| brush | Brush | Brush that determines the color and texture of the drawn text. |
| point | PointF | PointF structure that specifies the upper-left corner of the drawn text. |
| format | StringFormat | StringFormat that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text. |
DrawString(s, font, brush, layoutRectangle)
Draws the specified text string in the specified rectangle with the specified Brush and Font objects.
| Parameter | Type | Description |
|---|---|---|
| s | String | String to draw. |
| font | Font | Font that defines the text format of the string. |
| brush | Brush | Brush that determines the color and texture of the drawn text. |
| layoutRectangle | RectangleF | RectangleF structure that specifies the location of the drawn text. |
DrawString(s, font, brush, layoutRectangle, format)
Draws the specified text string in the specified rectangle with the specified Brush and Font objects using the formatting attributes of the specified StringFormat.
| Parameter | Type | Description |
|---|---|---|
| s | String | String to draw. |
| font | Font | Font that defines the text format of the string. |
| brush | Brush | Brush that determines the color and texture of the drawn text. |
| layoutRectangle | RectangleF | RectangleF structure that specifies the location of the drawn text. |
| format | StringFormat | StringFormat that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text. |
EndContainer(container)
Closes the current graphics container and restores the state of this Graphics to the state saved by a call to the BeginContainer method.
| Parameter | Type | Description |
|---|---|---|
| container | GraphicsContainer | GraphicsContainer that represents the container this method restores. |
FillClosedCurve(brush, points)
Fills the interior of a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | PointF[] | Array of PointF structures that define the spline. |
FillClosedCurve(brush, points, tension)
Fills the interior of a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | PointF[] | Array of PointF structures that define the spline. |
| tension | Single | Value greater than or equal to 0.0F that specifies the tension of the curve. |
FillClosedCurve(brush, points, fillMode)
Fills the interior of a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | PointF[] | Array of PointF structures that define the spline. |
| fillMode | FillMode | Member of the FillMode enumeration that determines how the curve is filled. |
FillClosedCurve(brush, points, fillMode, tension)
Fills the interior of a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | PointF[] | Array of PointF structures that define the spline. |
| fillMode | FillMode | Member of the FillMode enumeration that determines how the curve is filled. |
| tension | Single | Value greater than or equal to 0.0F that specifies the tension of the curve. |
FillClosedCurve(brush, points)
Fills the interior of a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | Point[] | Array of Point structures that define the spline. |
FillClosedCurve(brush, points, tension)
Fills the interior of a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | Point[] | Array of Point structures that define the spline. |
| tension | Single | Value greater than or equal to 0.0F that specifies the tension of the curve. |
FillClosedCurve(brush, points, fillMode)
Fills the interior of a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | Point[] | Array of Point structures that define the spline. |
| fillMode | FillMode | Member of the FillMode enumeration that determines how the curve is filled. |
FillClosedCurve(brush, points, fillMode, tension)
Fills the interior of a closed curve defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | Point[] | Array of Point structures that define the spline. |
| fillMode | FillMode | Member of the FillMode enumeration that determines how the curve is filled. |
| tension | Single | Value greater than or equal to 0.0F that specifies the tension of the curve. |
FillEllipse(brush, rect)
Fills the interior of an ellipse defined by a bounding rectangle specified by a Rectangle structure.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rect | Rectangle | Rectangle structure that represents the bounding rectangle that defines the ellipse. |
FillEllipse(brush, rect)
Fills the interior of an ellipse defined by a bounding rectangle specified by a RectangleF structure.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rect | RectangleF | RectangleF structure that represents the bounding rectangle that defines the ellipse. |
FillEllipse(brush, x, y, width, height)
Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| x | Int32 | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
| y | Int32 | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
| width | Int32 | Width of the bounding rectangle that defines the ellipse. |
| height | Int32 | Height of the bounding rectangle that defines the ellipse. |
FillEllipse(brush, x, y, width, height)
Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| x | Single | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
| y | Single | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
| width | Single | Width of the bounding rectangle that defines the ellipse. |
| height | Single | Height of the bounding rectangle that defines the ellipse. |
FillPath(brush, path)
Fills the interior of a GraphicsPath.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| path | GraphicsPath | GraphicsPath that represents the path to fill. |
Throws:
- ArgumentNullException brush is . -or- path is .
FillPie(brush, rect, startAngle, sweepAngle)
Fills the interior of a pie section defined by an ellipse specified by a Rectangle structure and two radial lines.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rect | Rectangle | Rectangle structure that represents the bounding rectangle that defines the ellipse from which the pie section comes. |
| startAngle | Single | Angle in degrees measured clockwise from the x-axis to the first side of the pie section. |
| sweepAngle | Single | Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section. |
FillPie(brush, rect, startAngle, sweepAngle)
Fills the interior of a pie section defined by an ellipse specified by a RectangleF structure and two radial lines.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rect | RectangleF | RectangleF structure that represents the bounding rectangle that defines the ellipse from which the pie section comes. |
| startAngle | Single | Angle in degrees measured clockwise from the x-axis to the first side of the pie section. |
| sweepAngle | Single | Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section. |
FillPie(brush, x, y, width, height, startAngle, sweepAngle)
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.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| x | Single | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
| y | Single | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
| width | Single | Width of the bounding rectangle that defines the ellipse from which the pie section comes. |
| height | Single | Height of the bounding rectangle that defines the ellipse from which the pie section comes. |
| startAngle | Single | Angle in degrees measured clockwise from the x-axis to the first side of the pie section. |
| sweepAngle | Single | Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section. |
FillPie(brush, x, y, width, height, startAngle, sweepAngle)
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.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| x | Int32 | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
| y | Int32 | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
| width | Int32 | Width of the bounding rectangle that defines the ellipse from which the pie section comes. |
| height | Int32 | Height of the bounding rectangle that defines the ellipse from which the pie section comes. |
| startAngle | Int32 | Angle in degrees measured clockwise from the x-axis to the first side of the pie section. |
| sweepAngle | Int32 | Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section. |
FillPolygon(brush, points)
Fills the interior of a polygon defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | PointF[] | Array of PointF points that represent the coordinates of the corners of the polygon |
FillPolygon(brush, points)
Fills the interior of a polygon defined by an array of points.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| points | Point[] | Array of PointF points that represent the coordinates of the corners of the polygon |
FillRectangle(brush, rect)
Fills the interior of a rectangle specified by a RectangleF structure with a Brush.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rect | RectangleF | Rectangle structure that represents the rectangle to fill. |
FillRectangle(brush, rect)
Fills the interior of a rectangle specified by a Rectangle structure with a Brush,
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rect | Rectangle | Rectangle structure that represents the rectangle to fill. |
FillRectangle(brush, x, y, width, height)
Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height with a Brush
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle to fill. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle to fill. |
| width | Int32 | Width of the rectangle to fill. |
| height | Int32 | Height of the rectangle to fill. |
FillRectangle(brush, x, y, width, height)
Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height with a Brush
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| x | Single | The x-coordinate of the upper-left corner of the rectangle to fill. |
| y | Single | The y-coordinate of the upper-left corner of the rectangle to fill. |
| width | Single | Width of the rectangle to fill. |
| height | Single | Height of the rectangle to fill. |
Throws:
- ArgumentNullException brush is .
FillRectangles(brush, rects)
Fills the interiors of a series of rectangles with a Brush.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rects | RectangleF[] | An array of RectangleF rectangles to be filled. |
FillRectangles(brush, rects)
Fills the interiors of a series of rectangles with a Brush.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| rects | Rectangle[] | An array of Rectangle rectangles to be filled. |
FillRegion(brush, region)
Fills the interior of a Region.
| Parameter | Type | Description |
|---|---|---|
| brush | Brush | Brush that determines the characteristics of the fill. |
| region | Region | Region that represents the area to fill. |
Throws:
- ArgumentNullException brush is . -or- region is .
Finalize()
Finalizes an instance of the Graphics class.
FromImage(image)
Creates an instance of the Graphics class from an existing Image.
| Parameter | Type | Description |
|---|---|---|
| image | Image | Image from which to create the new Graphics. |
Returns: Graphics. This method returns a new Graphics for the specified Image.
MeasureString(text, font, width, format)
Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.
| Parameter | Type | Description |
|---|---|---|
| text | String | String to measure. |
| font | Font | Font that defines the text format of the string. |
| width | Int32 | Maximum width of the string. |
| format | StringFormat | StringFormat that represents formatting information, such as line spacing, for the string. |
Returns: SizeF. This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified in the text parameter as drawn with the font parameter and the format parameter.
Throws:
- ArgumentException font is .
MeasureString(text, font, layoutArea)
Measures the specified string when drawn with the specified Font within the specified layout area.
| Parameter | Type | Description |
|---|---|---|
| text | String | String to measure. |
| font | Font | Font defines the text format of the string. |
| layoutArea | SizeF | SizeF structure that specifies the maximum layout area for the text. |
Returns: SizeF. This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified by the text parameter as drawn with the font parameter.
MeasureString(text, font, layoutArea, stringFormat)
Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.
| Parameter | Type | Description |
|---|---|---|
| text | String | String to measure. |
| font | Font | Font defines the text format of the string. |
| layoutArea | SizeF | SizeF structure that specifies the maximum layout area for the text. |
| stringFormat | StringFormat | StringFormat that represents formatting information, such as line spacing, for the string. |
Returns: SizeF. This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.
Throws:
- ArgumentNullException font is .
MeasureString(text, font, origin, stringFormat)
Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.
| Parameter | Type | Description |
|---|---|---|
| text | String | String to measure. |
| font | Font | Font defines the text format of the string. |
| origin | PointF | PointF structure that represents the upper-left corner of the string. |
| stringFormat | StringFormat | StringFormat that represents formatting information, such as line spacing, for the string. |
Returns: SizeF. This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.
Throws:
- ArgumentNullException font is .
MeasureString(text, font, width)
Measures the specified string when drawn with the specified Font.
| Parameter | Type | Description |
|---|---|---|
| text | String | String to measure. |
| font | Font | Font that defines the format of the string. |
| width | Int32 | Maximum width of the string in pixels. |
Returns: SizeF. This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified in the text parameter as drawn with the font parameter.
Throws:
- ArgumentNullException font is .
MeasureString(text, font)
Measures the specified string when drawn with the specified Font.
| Parameter | Type | Description |
|---|---|---|
| text | String | String to measure. |
| font | Font | Font that defines the format of the string. |
Returns: SizeF. This method returns a SizeF structure that represents the size, in the units specified by the PageUnit property, of the string specified in the text parameter as drawn with the font parameter.
Throws:
- ArgumentNullException font is .
MeasureString(text, font, layoutArea, stringFormat, charactersFitted, linesFilled)
Measures the specified string when drawn with the specified Font and formatted with the specified StringFormat.
| Parameter | Type | Description |
|---|---|---|
| text | String | String to measure. |
| font | Font | Font defines the text format of the string. |
| layoutArea | SizeF | SizeF structure that specifies the maximum layout area for the text. |
| stringFormat | StringFormat | StringFormat that represents formatting information, such as line spacing, for the string. |
| charactersFitted | Int32 | Number of characters in the string. |
| linesFilled | Int32 | Number of text lines in the string. |
Returns: SizeF. This method returns a SizeF structure that represents the size of the string, in the units specified by the PageUnit property, of the text parameter as drawn with the font parameter and the stringFormat parameter.
RotateTransform(angle)
Applies the specified rotation to the transformation matrix of this Graphics.
| Parameter | Type | Description |
|---|---|---|
| angle | Single | Angle of rotation in degrees. |
RotateTransform(angle, order)
Applies the specified rotation to the transformation matrix of this Graphics in the specified order.
| Parameter | Type | Description |
|---|---|---|
| angle | Single | Angle of rotation in degrees. |
| order | MatrixOrder | Member of the MatrixOrder enumeration that specifies whether the rotation is prepended or appended to the transformation matrix. |
ScaleTransform(sx, sy)
Applies the specified scaling operation to the transformation matrix of this Graphics by prepending it to the object's transformation matrix.
| Parameter | Type | Description |
|---|---|---|
| sx | Single | Scale factor in the x direction. |
| sy | Single | Scale factor in the y direction. |
ScaleTransform(sx, sy, order)
Applies the specified scaling operation to the transformation matrix of this Graphics by prepending it to the object's transformation matrix.
| Parameter | Type | Description |
|---|---|---|
| sx | Single | Scale factor in the x direction. |
| sy | Single | Scale factor in the y direction. |
| order | MatrixOrder | Member of the MatrixOrder enumeration that specifies whether the scaling operation is prepended or appended to the transformation matrix. |
SetClip(rect)
Sets the clipping region of this Graphics to the rectangle specified by a RectangleF structure.
| Parameter | Type | Description |
|---|---|---|
| rect | RectangleF | RectangleF structure that represents the new clip region. |
SetClip(rect)
Sets the clipping region of this Graphics to the rectangle specified by a Rectangle structure.
| Parameter | Type | Description |
|---|---|---|
| rect | Rectangle | Rectangle structure that represents the new clip region. |
SetClip(graphicsPath)
Sets the clipping region of this Graphics to the specified GraphicsPath.
| Parameter | Type | Description |
|---|---|---|
| graphicsPath | GraphicsPath | GraphicsPath that represents the new clip region. |
SetClip(g)
Sets the clipping region of this Graphics to the Clip property of the specified Graphics.
| Parameter | Type | Description |
|---|---|---|
| g | Graphics | Graphics from which to take the new clip region. |
SetClip(rect, 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.
| Parameter | Type | Description |
|---|---|---|
| rect | RectangleF | RectangleF structure to combine. |
| combineMode | CombineMode | Member from the CombineMode enumeration that specifies the combining operation to use. |
SetClip(rect, 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.
| Parameter | Type | Description |
|---|---|---|
| rect | Rectangle | Rectangle structure to combine. |
| combineMode | CombineMode | Member from the CombineMode enumeration that specifies the combining operation to use. |
SetClip(graphicsPath, 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 GraphicsPath.
| Parameter | Type | Description |
|---|---|---|
| graphicsPath | GraphicsPath | GraphicsPath to combine. |
| combineMode | CombineMode | Member from the CombineMode enumeration that specifies the combining operation to use. |
SetClip(g, 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.
| Parameter | Type | Description |
|---|---|---|
| g | Graphics | Graphics that specifies the clip region to combine. |
| combineMode | CombineMode | Member from the CombineMode enumeration that specifies the combining operation to use. |
SetClip(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.
| Parameter | Type | Description |
|---|---|---|
| region | Region | Region to combine. |
| combineMode | CombineMode | Member from the CombineMode enumeration that specifies the combining operation to use. |
TranslateTransform(dx, dy)
Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this Graphics.
| Parameter | Type | Description |
|---|---|---|
| dx | Single | The x-coordinate of the translation. |
| dy | Single | The y-coordinate of the translation. |
TranslateTransform(dx, dy, order)
Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this Graphics.
| Parameter | Type | Description |
|---|---|---|
| dx | Single | The x-coordinate of the translation. |
| dy | Single | The y-coordinate of the translation. |
| order | MatrixOrder | Member of the MatrixOrder enumeration that specifies whether the translation is prepended or appended to the transformation matrix. |