Table of Contents

Class Graphics

Namespace
Aspose.Imaging
Assembly
Aspose.Imaging.dll

Represents the graphics according to the graphics engine used in the current assembly.

public sealed class Graphics
Inheritance
Graphics
Inherited Members

Constructors

Graphics(Image)

Initializes a new instance of the Graphics class.

public Graphics(Image sourceImage)

Parameters

sourceImage Image

The source image.

Properties

Clip

Gets or sets the clip region.

public Region Clip { get; set; }

Property Value

Region

The clip region.

CompositingQuality

Gets or sets the compositing quality.

public CompositingQuality CompositingQuality { get; set; }

Property Value

CompositingQuality

The compositing quality.

DpiX

Gets the horizontal resolution of this Aspose.Imaging.Graphics.

public float DpiX { get; }

Property Value

float

The value, in dots per inch, for the horizontal resolution supported by this Aspose.Imaging.Graphics.

DpiY

Gets the vertical resolution of this Aspose.Imaging.Graphics.

public float DpiY { get; }

Property Value

float

The value, in dots per inch, for the vertical resolution supported by this Aspose.Imaging.Graphics.

Image

Gets the image.

public Image Image { get; }

Property Value

Image

The graphics image.

InterpolationMode

Gets or sets the interpolation mode.

public InterpolationMode InterpolationMode { get; set; }

Property Value

InterpolationMode

The interpolation mode.

IsInBeginUpdateCall

Gets a value indicating whether graphics is in BeginUpdate call state.

public bool IsInBeginUpdateCall { get; }

Property Value

bool

True if graphics is in BeginUpdate call state; otherwise, false.

PageScale

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

public float PageScale { get; set; }

Property Value

float

The scaling between world units and page units for this Aspose.Imaging.Graphics.

PageUnit

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

public GraphicsUnit PageUnit { get; set; }

Property Value

GraphicsUnit

The unit of measure used for page coordinates in this Aspose.Imaging.Graphics.

PaintableImageOptions

Gets or sets image options, used to create paintable vactor images to draw.

public ImageOptionsBase PaintableImageOptions { get; set; }

Property Value

ImageOptionsBase

The image options, used to create paintable vactor images to draw.

SmoothingMode

Gets or sets the smoothing mode.

public SmoothingMode SmoothingMode { get; set; }

Property Value

SmoothingMode

The smoothing mode.

TextRenderingHint

Gets or sets the text rendering hint.

public TextRenderingHint TextRenderingHint { get; set; }

Property Value

TextRenderingHint

The text rendering hint.

Transform

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

public Matrix Transform { get; set; }

Property Value

Matrix

A copy of the Matrix that represents the geometric world transformation for this Graphics.

Methods

BeginUpdate()

Starts caching of the following graphics operations. The graphics effects applied afterwards will not be applied immediately instead the EndUpdate will cause applying all the effects at once.

public void BeginUpdate()

Remarks

Note the effects after BeginUpdate is called will not be applied in case EndUpdate is not called.

Clear(Color)

Clears the graphics surface using the specified color.

public void Clear(Color color)

Parameters

color Color

The color to clear the graphics surface by.

DrawArc(Pen, Rectangle, float, float)

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

public void DrawArc(Pen pen, Rectangle rect, float startAngle, float sweepAngle)

Parameters

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 float

Angle in degrees measured clockwise from the x-axis to the starting point of the arc.

sweepAngle float

Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.

Exceptions

ArgumentNullException

pen is null.

DrawArc(Pen, RectangleF, float, float)

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

public void DrawArc(Pen pen, RectangleF rect, float startAngle, float sweepAngle)

Parameters

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 float

Angle in degrees measured clockwise from the x-axis to the starting point of the arc.

sweepAngle float

Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.

Exceptions

ArgumentNullException

pen is null

DrawArc(Pen, int, int, int, int, int, int)

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

public void DrawArc(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)

Parameters

pen Pen

Pen that determines the color, width, and style of the arc.

x int

The x-coordinate of the upper-left corner of the rectangle that defines the ellipse.

y int

The y-coordinate of the upper-left corner of the rectangle that defines the ellipse.

width int

Width of the rectangle that defines the ellipse.

height int

Height of the rectangle that defines the ellipse.

startAngle int

Angle in degrees measured clockwise from the x-axis to the starting point of the arc.

sweepAngle int

Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.

Exceptions

ArgumentNullException

pen is null.

DrawArc(Pen, float, float, float, float, float, float)

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

public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)

Parameters

pen Pen

Pen that determines the color, width, and style of the arc.

x float

The x-coordinate of the upper-left corner of the rectangle that defines the ellipse.

y float

The y-coordinate of the upper-left corner of the rectangle that defines the ellipse.

width float

Width of the rectangle that defines the ellipse.

height float

Height of the rectangle that defines the ellipse.

startAngle float

Angle in degrees measured clockwise from the x-axis to the starting point of the arc.

sweepAngle float

Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.

Exceptions

ArgumentNullException

pen is null.

DrawBezier(Pen, Point, Point, Point, Point)

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

public void DrawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)

Parameters

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.

Exceptions

ArgumentNullException

pen is null.

DrawBezier(Pen, PointF, PointF, PointF, PointF)

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

public void DrawBezier(Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)

Parameters

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.

Exceptions

ArgumentNullException

pen is null.

DrawBezier(Pen, float, float, float, float, float, float, float, float)

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

public void DrawBezier(Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)

Parameters

pen Pen

Pen that determines the color, width, and style of the curve.

x1 float

The x-coordinate of the starting point of the curve.

y1 float

The y-coordinate of the starting point of the curve.

x2 float

The x-coordinate of the first control point of the curve.

y2 float

The y-coordinate of the first control point of the curve.

x3 float

The x-coordinate of the second control point of the curve.

y3 float

The y-coordinate of the second control point of the curve.

x4 float

The x-coordinate of the ending point of the curve.

y4 float

The y-coordinate of the ending point of the curve.

Exceptions

ArgumentNullException

pen is null.

DrawBeziers(Pen, PointF[])

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

public void DrawBeziers(Pen pen, PointF[] points)

Parameters

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.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawBeziers(Pen, Point[])

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

public void DrawBeziers(Pen pen, Point[] points)

Parameters

pen Pen

Pen that determines the color, width, and style of the curve.

points Point[]

Array of Point structures that represent the points that determine the curve.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawClosedCurve(Pen, PointF[])

Draws a closed cardinal spline defined by an array of PointF structures. This method uses a default tension of 0.5 and Alternate fill mode.

public void DrawClosedCurve(Pen pen, PointF[] points)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points PointF[]

Array of PointF structures that define the spline.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawClosedCurve(Pen, PointF[], float)

Draws a closed cardinal spline defined by an array of PointF structures using a specified tension. This method uses a default Alternate fill mode.

public void DrawClosedCurve(Pen pen, PointF[] points, float tension)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points PointF[]

Array of PointF structures that define the spline.

tension float

Value greater than or equal to 0.0F that specifies the tension of the curve.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawClosedCurve(Pen, Point[])

Draws a closed cardinal spline defined by an array of Point structures. This method uses a default tension of 0.5 and Alternate fill mode.

public void DrawClosedCurve(Pen pen, Point[] points)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points Point[]

Array of Point structures that define the spline.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawClosedCurve(Pen, Point[], float)

Draws a closed cardinal spline defined by an array of Point structures using a specified tension. This method uses a default Alternate fill mode.

public void DrawClosedCurve(Pen pen, Point[] points, float tension)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points Point[]

Array of Point structures that define the spline.

tension float

Value greater than or equal to 0.0F that specifies the tension of the curve.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawCurve(Pen, PointF[])

Draws a cardinal spline through a specified array of PointF structures. This method uses a default tension of 0.5.

public void DrawCurve(Pen pen, PointF[] points)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points PointF[]

Array of PointF structures that define the spline.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawCurve(Pen, PointF[], int, int)

Draws a cardinal spline through a specified array of PointF structures. The drawing begins offset from the beginning of the array. This method uses a default tension of 0.5.

public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points PointF[]

Array of PointF structures that define the spline.

offset int

Offset from the first element in the array of the points parameter to the starting point in the curve.

numberOfSegments int

Number of segments after the starting point to include in the curve.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawCurve(Pen, PointF[], int, int, float)

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.

public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points PointF[]

Array of PointF structures that define the spline.

offset int

Offset from the first element in the array of the points parameter to the starting point in the curve.

numberOfSegments int

Number of segments after the starting point to include in the curve.

tension float

Value greater than or equal to 0.0F that specifies the tension of the curve.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawCurve(Pen, PointF[], float)

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

public void DrawCurve(Pen pen, PointF[] points, float tension)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points PointF[]

Array of PointF structures that represent the points that define the curve.

tension float

Value greater than or equal to 0.0F that specifies the tension of the curve.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawCurve(Pen, Point[])

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

public void DrawCurve(Pen pen, Point[] points)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points Point[]

Array of Point structures that define the spline.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawCurve(Pen, Point[], int, int, float)

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

public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points Point[]

Array of Point structures that define the spline.

offset int

Offset from the first element in the array of the points parameter to the starting point in the curve.

numberOfSegments int

Number of segments after the starting point to include in the curve.

tension float

Value greater than or equal to 0.0F that specifies the tension of the curve.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawCurve(Pen, Point[], float)

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

public void DrawCurve(Pen pen, Point[] points, float tension)

Parameters

pen Pen

Pen that determines the color, width, and height of the curve.

points Point[]

Array of Point structures that define the spline.

tension float

Value greater than or equal to 0.0F that specifies the tension of the curve.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawEllipse(Pen, Rectangle)

Draws an ellipse specified by a bounding Rectangle structure.

public void DrawEllipse(Pen pen, Rectangle rect)

Parameters

pen Pen

Pen that determines the color, width, and style of the ellipse.

rect Rectangle

Rectangle structure that defines the boundaries of the ellipse.

Exceptions

ArgumentNullException

pen is null.

DrawEllipse(Pen, RectangleF)

Draws an ellipse defined by a bounding RectangleF.

public void DrawEllipse(Pen pen, RectangleF rect)

Parameters

pen Pen

Pen that determines the color, width, and style of the ellipse.

rect RectangleF

RectangleF structure that defines the boundaries of the ellipse.

Exceptions

ArgumentNullException

pen is null.

DrawEllipse(Pen, int, int, int, int)

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

public void DrawEllipse(Pen pen, int x, int y, int width, int height)

Parameters

pen Pen

Pen that determines the color, width, and style of the ellipse.

x int

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y int

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

width int

Width of the bounding rectangle that defines the ellipse.

height int

Height of the bounding rectangle that defines the ellipse.

Exceptions

ArgumentNullException

pen is null.

DrawEllipse(Pen, float, float, float, float)

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

public void DrawEllipse(Pen pen, float x, float y, float width, float height)

Parameters

pen Pen

Pen that determines the color, width, and style of the ellipse.

x float

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y float

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

width float

Width of the bounding rectangle that defines the ellipse.

height float

Height of the bounding rectangle that defines the ellipse.

Exceptions

ArgumentNullException

pen is null.

DrawImage(Image, Point)

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

public void DrawImage(Image sourceImage, Point point)

Parameters

sourceImage Image

The image to draw with.

point Point

Point structure that represents the location of the upper-left corner of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, PointF)

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

public void DrawImage(Image sourceImage, PointF point)

Parameters

sourceImage Image

The image to draw with.

point PointF

PointF structure that represents the upper-left corner of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, PointF[])

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

public void DrawImage(Image image, PointF[] destPoints)

Parameters

image Image

The image to draw.

destPoints PointF[]

Array of three PointF structures that define a parallelogram.

Exceptions

ArgumentNullException

image

DrawImage(Image, PointF[], RectangleF)

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

public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect)

Parameters

image Image

The image to draw.

destPoints PointF[]

Array of three PointF structures that define a parallelogram.

srcRect RectangleF

The source rectangle.

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

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

public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)

Parameters

image Image

The image to draw.

destPoints PointF[]

Array of three PointF structures that define a parallelogram.

srcRect RectangleF

The source rectangle.

srcUnit GraphicsUnit

The units of measure.

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

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

public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)

Parameters

image Image

The image to draw.

destPoints PointF[]

Array of three PointF structures that define a parallelogram.

srcRect RectangleF

The source rectangle.

srcUnit GraphicsUnit

The units of measure.

imageAttributes ImageAttributes

The image attributes.

DrawImage(Image, Point[])

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

public void DrawImage(Image image, Point[] destPoints)

Parameters

image Image

The image to draw.

destPoints Point[]

Array of three PointF structures that define a parallelogram.

DrawImage(Image, Point[], Rectangle)

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

public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect)

Parameters

image Image

The image to draw.

destPoints Point[]

Array of three PointF structures that define a parallelogram.

srcRect Rectangle

The source rectangle.

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

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

public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)

Parameters

image Image

The image to draw.

destPoints Point[]

Array of three PointF structures that define a parallelogram.

srcRect Rectangle

The source rectangle.

srcUnit GraphicsUnit

The units of measure.

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

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

public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttributes)

Parameters

image Image

The image to draw.

destPoints Point[]

Array of three PointF structures that define a parallelogram.

srcRect Rectangle

The source rectangle.

srcUnit GraphicsUnit

The units of measure.

imageAttributes ImageAttributes

The image attributes.

DrawImage(Image, Rectangle)

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

public void DrawImage(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

The image to draw with.

rect Rectangle

Rectangle structure that specifies the location and size of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, Rectangle, GraphicsUnit)

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

public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit)

Parameters

sourceImage Image

The image to draw with.

rectDestination Rectangle

The destination rectangle.

graphicsUnit GraphicsUnit

The graphics unit.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, Rectangle, GraphicsUnit, ImageAttributes)

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

public void DrawImage(Image sourceImage, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)

Parameters

sourceImage Image

The image to draw with.

rectDestination Rectangle

The destination rectangle.

graphicsUnit GraphicsUnit

The graphics unit.

imageAttributes ImageAttributes

The image attributes.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, Rectangle, Rectangle, GraphicsUnit)

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

public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit)

Parameters

sourceImage Image

The image to draw with.

rectSource Rectangle

The rect source.

rectDestination Rectangle

The rect destination.

graphicsUnit GraphicsUnit

The graphics unit.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, Rectangle, Rectangle, GraphicsUnit, ImageAttributes)

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

public void DrawImage(Image sourceImage, Rectangle rectSource, Rectangle rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)

Parameters

sourceImage Image

The image to draw with.

rectSource Rectangle

The rect source.

rectDestination Rectangle

The rect destination.

graphicsUnit GraphicsUnit

The graphics unit.

imageAttributes ImageAttributes

The image attributes.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, RectangleF)

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

public void DrawImage(Image sourceImage, RectangleF rect)

Parameters

sourceImage Image

The image to draw with.

rect RectangleF

RectangleF structure that specifies the location and size of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, RectangleF, GraphicsUnit)

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

public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit)

Parameters

sourceImage Image

The image to draw with.

rectDestination RectangleF

The destination rectangle.

graphicsUnit GraphicsUnit

The graphics unit.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, RectangleF, GraphicsUnit, ImageAttributes)

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

public void DrawImage(Image sourceImage, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)

Parameters

sourceImage Image

The image to draw with.

rectDestination RectangleF

The destination rectangle to draw in.

graphicsUnit GraphicsUnit

The graphics unit.

imageAttributes ImageAttributes

The image attributes.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, RectangleF, RectangleF, GraphicsUnit)

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

public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit)

Parameters

sourceImage Image

The image to draw with.

rectSource RectangleF

The rect source.

rectDestination RectangleF

The rect destination.

graphicsUnit GraphicsUnit

The graphics unit.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, RectangleF, RectangleF, GraphicsUnit, ImageAttributes)

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

public void DrawImage(Image sourceImage, RectangleF rectSource, RectangleF rectDestination, GraphicsUnit graphicsUnit, ImageAttributes imageAttributes)

Parameters

sourceImage Image

The image to draw with.

rectSource RectangleF

The source rectangle.

rectDestination RectangleF

The destination rectangle.

graphicsUnit GraphicsUnit

The graphics unit to use.

imageAttributes ImageAttributes

The image attributes to use.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, int, int)

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

public void DrawImage(Image sourceImage, int x, int y)

Parameters

sourceImage Image

The image to draw with.

x int

The x-coordinate of the upper-left corner of the drawn image.

y int

The y-coordinate of the upper-left corner of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, int, int, int, int)

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

public void DrawImage(Image sourceImage, int x, int y, int width, int height)

Parameters

sourceImage Image

The image to draw with.

x int

The x-coordinate of the upper-left corner of the drawn image.

y int

The y-coordinate of the upper-left corner of the drawn image.

width int

Width of the drawn image.

height int

Height of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, float, float)

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

public void DrawImage(Image sourceImage, float x, float y)

Parameters

sourceImage Image

The image to draw with.

x float

The x-coordinate of the upper-left corner of the drawn image.

y float

The y-coordinate of the upper-left corner of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImage(Image, float, float, float, float)

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

public void DrawImage(Image sourceImage, float x, float y, float width, float height)

Parameters

sourceImage Image

The image to draw with.

x float

The x-coordinate of the upper-left corner of the drawn image.

y float

The y-coordinate of the upper-left corner of the drawn image.

width float

Width of the drawn image.

height float

Height of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImageUnscaled(Image, Point)

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

public void DrawImageUnscaled(Image sourceImage, Point point)

Parameters

sourceImage Image

The image to draw with.

point Point

Point structure that specifies the upper-left corner of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImageUnscaled(Image, Rectangle)

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

public void DrawImageUnscaled(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

The image to draw with.

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.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImageUnscaled(Image, int, int)

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

public void DrawImageUnscaled(Image sourceImage, int x, int y)

Parameters

sourceImage Image

The image to draw with.

x int

The x-coordinate of the upper-left corner of the drawn image.

y int

The y-coordinate of the upper-left corner of the drawn image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImageUnscaled(Image, int, int, int, int)

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

public void DrawImageUnscaled(Image sourceImage, int x, int y, int width, int height)

Parameters

sourceImage Image

The image to draw with.

x int

The x-coordinate of the upper-left corner of the drawn image.

y int

The y-coordinate of the upper-left corner of the drawn image.

width int

The parameter is not used.

height int

The parameter is not used.

Exceptions

ArgumentNullException

sourceImage is null.

DrawImageUnscaledAndClipped(Image, Rectangle)

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

public void DrawImageUnscaledAndClipped(Image sourceImage, Rectangle rect)

Parameters

sourceImage Image

The image to draw with.

rect Rectangle

The Rectangle in which to draw the image.

Exceptions

ArgumentNullException

sourceImage is null.

DrawLine(Pen, Point, Point)

Draws a line connecting two Point structures.

public void DrawLine(Pen pen, Point point1, Point point2)

Parameters

pen Pen

Pen that determines the color, width, and style of the line.

point1 Point

Point structure that represents the first point to connect.

point2 Point

Point structure that represents the second point to connect.

Exceptions

ArgumentNullException

pen is null.

DrawLine(Pen, PointF, PointF)

Draws a line connecting two PointF structures.

public void DrawLine(Pen pen, PointF point1, PointF point2)

Parameters

pen Pen

Pen that determines the color, width, and style of the line.

point1 PointF

PointF structure that represents the first point to connect.

point2 PointF

PointF structure that represents the second point to connect.

Exceptions

ArgumentNullException

pen is null.

DrawLine(Pen, int, int, int, int)

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

public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)

Parameters

pen Pen

Pen that determines the color, width, and style of the line.

x1 int

The x-coordinate of the first point.

y1 int

The y-coordinate of the first point.

x2 int

The x-coordinate of the second point.

y2 int

The y-coordinate of the second point.

Exceptions

ArgumentNullException

pen is null.

DrawLine(Pen, float, float, float, float)

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

public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)

Parameters

pen Pen

Pen that determines the color, width, and style of the line.

x1 float

The x-coordinate of the first point.

y1 float

The y-coordinate of the first point.

x2 float

The x-coordinate of the second point.

y2 float

The y-coordinate of the second point.

Exceptions

ArgumentNullException

pen is null.

DrawLines(Pen, PointF[])

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

public void DrawLines(Pen pen, PointF[] points)

Parameters

pen Pen

Pen that determines the color, width, and style of the line segments.

points PointF[]

Array of PointF structures that represent the points to connect.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

ArgumentException

The points array contains less than 2 points.

DrawLines(Pen, Point[])

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

public void DrawLines(Pen pen, Point[] points)

Parameters

pen Pen

Pen that determines the color, width, and style of the line segments.

points Point[]

Array of Point structures that represent the points to connect.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

ArgumentException

The points array contains less than 2 points.

DrawPath(Pen, GraphicsPath)

Draws a GraphicsPath.

public void DrawPath(Pen pen, GraphicsPath path)

Parameters

pen Pen

Pen that determines the color, width, and style of the path.

path GraphicsPath

GraphicsPath to draw.

Exceptions

ArgumentNullException

pen is null. -or- path is null.

DrawPie(Pen, Rectangle, float, float)

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

public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle)

Parameters

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 float

Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.

sweepAngle float

Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.

Exceptions

ArgumentNullException

pen is null.

DrawPie(Pen, RectangleF, float, float)

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

public void DrawPie(Pen pen, RectangleF rect, float startAngle, float sweepAngle)

Parameters

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 float

Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.

sweepAngle float

Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.

Exceptions

ArgumentNullException

pen is null.

DrawPie(Pen, int, int, int, int, int, int)

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

public void DrawPie(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)

Parameters

pen Pen

Pen that determines the color, width, and style of the pie shape.

x int

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.

y int

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.

width int

Width of the bounding rectangle that defines the ellipse from which the pie shape comes.

height int

Height of the bounding rectangle that defines the ellipse from which the pie shape comes.

startAngle int

Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.

sweepAngle int

Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.

Exceptions

ArgumentNullException

pen is null.

DrawPie(Pen, float, float, float, float, float, float)

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

public void DrawPie(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)

Parameters

pen Pen

Pen that determines the color, width, and style of the pie shape.

x float

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.

y float

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.

width float

Width of the bounding rectangle that defines the ellipse from which the pie shape comes.

height float

Height of the bounding rectangle that defines the ellipse from which the pie shape comes.

startAngle float

Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.

sweepAngle float

Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.

Exceptions

ArgumentNullException

pen is null.

DrawPolygon(Pen, PointF[])

Draws a polygon defined by an array of PointF structures.

public void DrawPolygon(Pen pen, PointF[] points)

Parameters

pen Pen

Pen that determines the color, width, and style of the polygon.

points PointF[]

Array of PointF structures that represent the vertices of the polygon.

Exceptions

ArgumentNullException

pen is null. -or- points is null.

DrawPolygon(Pen, Point[])

Draws a polygon defined by an array of Point structures.

public void DrawPolygon(Pen pen, Point[] points)

Parameters

pen Pen

Pen that determines the color, width, and style of the polygon.

points Point[]

Array of Point structures that represent the vertices of the polygon.

Exceptions

ArgumentNullException

pen is null.

DrawRectangle(Pen, Rectangle)

Draws a rectangle specified by a Rectangle structure.

public void DrawRectangle(Pen pen, Rectangle rect)

Parameters

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.

Exceptions

ArgumentNullException

pen is null.

DrawRectangle(Pen, RectangleF)

Draws a rectangle specified by a RectangleF structure.

public void DrawRectangle(Pen pen, RectangleF rect)

Parameters

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.

Exceptions

ArgumentNullException

pen is null.

DrawRectangle(Pen, int, int, int, int)

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

public void DrawRectangle(Pen pen, int x, int y, int width, int height)

Parameters

pen Pen

Pen that determines the color, width, and style of the rectangle.

x int

The x-coordinate of the upper-left corner of the rectangle to draw.

y int

The y-coordinate of the upper-left corner of the rectangle to draw.

width int

Width of the rectangle to draw.

height int

Height of the rectangle to draw.

Exceptions

ArgumentNullException

pen is null.

DrawRectangle(Pen, float, float, float, float)

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

public void DrawRectangle(Pen pen, float x, float y, float width, float height)

Parameters

pen Pen

A Pen that determines the color, width, and style of the rectangle.

x float

The x-coordinate of the upper-left corner of the rectangle to draw.

y float

The y-coordinate of the upper-left corner of the rectangle to draw.

width float

The width of the rectangle to draw.

height float

The height of the rectangle to draw.

Exceptions

ArgumentNullException

pen is null.

DrawRectangles(Pen, RectangleF[])

Draws a series of rectangles specified by RectangleF structures.

public void DrawRectangles(Pen pen, RectangleF[] rects)

Parameters

pen Pen

Pen that determines the color, width, and style of the outlines of the rectangles.

rects RectangleF[]

Array of RectangleF structures that represent the rectangles to draw.

Exceptions

ArgumentNullException

pen is null. -or- rects is null.

DrawRectangles(Pen, Rectangle[])

Draws a series of rectangles specified by Rectangle structures.

public void DrawRectangles(Pen pen, Rectangle[] rects)

Parameters

pen Pen

Pen that determines the color, width, and style of the outlines of the rectangles.

rects Rectangle[]

Array of Rectangle structures that represent the rectangles to draw.

Exceptions

ArgumentNullException

pen is null. -or- rects is null.

DrawString(string, Font, Brush, PointF)

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

public void DrawString(string s, Font font, Brush brush, PointF point)

Parameters

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.

Exceptions

ArgumentNullException

brush is null. -or- s is null.

DrawString(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.

public void DrawString(string s, Font font, Brush brush, PointF point, StringFormat format)

Parameters

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.

Exceptions

ArgumentNullException

brush is null. -or- s is null.

DrawString(string, Font, Brush, RectangleF)

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

public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle)

Parameters

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.

Exceptions

ArgumentNullException

brush is null. -or- s is null.

DrawString(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.

public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)

Parameters

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.

Exceptions

ArgumentNullException

brush is null. -or- s is null. -or- brush is null.

DrawString(string, Font, Brush, float, float)

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

public void DrawString(string s, Font font, Brush brush, float x, float y)

Parameters

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 float

The x-coordinate of the upper-left corner of the drawn text.

y float

The y-coordinate of the upper-left corner of the drawn text.

Exceptions

ArgumentNullException

brush is null. -or- s is null.

DrawString(string, Font, Brush, float, float, 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.

public void DrawString(string s, Font font, Brush brush, float x, float y, StringFormat format)

Parameters

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 float

The x-coordinate of the upper-left corner of the drawn text.

y float

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.

Exceptions

ArgumentNullException

brush is null. -or- s is null.

EndUpdate()

Finishes caching of the graphics operations started after BeginUpdate was called. The preceding graphics operations will be applied at once when calling this method.

public void EndUpdate()

FillClosedCurve(Brush, PointF[])

Fills the interior of a closed cardinal spline curve defined by an array of PointF structures. This method uses a default tension of 0.5 and Alternate fill mode.

public void FillClosedCurve(Brush brush, PointF[] points)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

points PointF[]

Array of PointF structures that define the spline.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillClosedCurve(Brush, PointF[], FillMode)

Fills the interior of a closed cardinal spline curve defined by an array of PointF structures using the specified fill mode. This method uses a default tension of 0.5.

public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode)

Parameters

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.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillClosedCurve(Brush, PointF[], FillMode, float)

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

public void FillClosedCurve(Brush brush, PointF[] points, FillMode fillmode, float tension)

Parameters

brush Brush

A 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 float

Value greater than or equal to 0.0F that specifies the tension of the curve.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillClosedCurve(Brush, Point[])

Fills the interior of a closed cardinal spline curve defined by an array of Point structures. This method uses a default tension of 0.5 and Alternate fill mode.

public void FillClosedCurve(Brush brush, Point[] points)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

points Point[]

Array of Point structures that define the spline.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillClosedCurve(Brush, Point[], FillMode)

Fills the interior of a closed cardinal spline curve defined by an array of Point structures using the specified fill mode. This method uses a default tension of 0.5.

public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode)

Parameters

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.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillClosedCurve(Brush, Point[], FillMode, float)

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

public void FillClosedCurve(Brush brush, Point[] points, FillMode fillmode, float tension)

Parameters

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 float

Value greater than or equal to 0.0F that specifies the tension of the curve.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillEllipse(Brush, Rectangle)

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

public void FillEllipse(Brush brush, Rectangle rect)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

rect Rectangle

Rectangle structure that represents the bounding rectangle that defines the ellipse.

Exceptions

ArgumentNullException

brush is null.

FillEllipse(Brush, RectangleF)

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

public void FillEllipse(Brush brush, RectangleF rect)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

rect RectangleF

RectangleF structure that represents the bounding rectangle that defines the ellipse.

Exceptions

ArgumentNullException

brush is null.

FillEllipse(Brush, int, int, int, int)

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

public void FillEllipse(Brush brush, int x, int y, int width, int height)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

x int

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y int

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

width int

Width of the bounding rectangle that defines the ellipse.

height int

Height of the bounding rectangle that defines the ellipse.

Exceptions

ArgumentNullException

brush is null.

FillEllipse(Brush, float, float, float, float)

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

public void FillEllipse(Brush brush, float x, float y, float width, float height)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

x float

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y float

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

width float

Width of the bounding rectangle that defines the ellipse.

height float

Height of the bounding rectangle that defines the ellipse.

Exceptions

ArgumentNullException

brush is null.

FillPath(Brush, GraphicsPath)

Fills the interior of a GraphicsPath.

public void FillPath(Brush brush, GraphicsPath path)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

path GraphicsPath

GraphicsPath that represents the path to fill.

Exceptions

ArgumentNullException

brush is null. -or- path is null.

FillPie(Brush, Rectangle, float, float)

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

public void FillPie(Brush brush, Rectangle rect, float startAngle, float sweepAngle)

Parameters

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 float

Angle in degrees measured clockwise from the x-axis to the first side of the pie section.

sweepAngle float

Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.

Exceptions

ArgumentNullException

brush is null.

FillPie(Brush, RectangleF, float, float)

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

public void FillPie(Brush brush, RectangleF rect, float startAngle, float sweepAngle)

Parameters

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 float

Angle in degrees measured clockwise from the x-axis to the first side of the pie section.

sweepAngle float

Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.

Exceptions

ArgumentNullException

brush is null.

FillPie(Brush, int, int, int, int, int, int)

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.

public void FillPie(Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

x int

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.

y int

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.

width int

Width of the bounding rectangle that defines the ellipse from which the pie section comes.

height int

Height of the bounding rectangle that defines the ellipse from which the pie section comes.

startAngle int

Angle in degrees measured clockwise from the x-axis to the first side of the pie section.

sweepAngle int

Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.

Exceptions

ArgumentNullException

brush is null.

FillPie(Brush, float, float, float, float, float, float)

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.

public void FillPie(Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

x float

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.

y float

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.

width float

Width of the bounding rectangle that defines the ellipse from which the pie section comes.

height float

Height of the bounding rectangle that defines the ellipse from which the pie section comes.

startAngle float

Angle in degrees measured clockwise from the x-axis to the first side of the pie section.

sweepAngle float

Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.

Exceptions

ArgumentNullException

brush is null.

FillPolygon(Brush, PointF[])

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

public void FillPolygon(Brush brush, PointF[] points)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

points PointF[]

Array of PointF structures that represent the vertices of the polygon to fill.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillPolygon(Brush, PointF[], FillMode)

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

public void FillPolygon(Brush brush, PointF[] points, FillMode fillMode)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

points PointF[]

Array of PointF structures that represent the vertices of the polygon to fill.

fillMode FillMode

Member of the FillMode enumeration that determines the style of the fill.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillPolygon(Brush, Point[])

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

public void FillPolygon(Brush brush, Point[] points)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

points Point[]

Array of Point structures that represent the vertices of the polygon to fill.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillPolygon(Brush, Point[], FillMode)

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

public void FillPolygon(Brush brush, Point[] points, FillMode fillMode)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

points Point[]

Array of Point structures that represent the vertices of the polygon to fill.

fillMode FillMode

Member of the FillMode enumeration that determines the style of the fill.

Exceptions

ArgumentNullException

brush is null. -or- points is null.

FillRectangle(Brush, Rectangle)

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

public void FillRectangle(Brush brush, Rectangle rect)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

rect Rectangle

Rectangle structure that represents the rectangle to fill.

Exceptions

ArgumentNullException

brush is null.

FillRectangle(Brush, RectangleF)

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

public void FillRectangle(Brush brush, RectangleF rect)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

rect RectangleF

RectangleF structure that represents the rectangle to fill.

Exceptions

ArgumentNullException

brush is null.

FillRectangle(Brush, int, int, int, int)

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

public void FillRectangle(Brush brush, int x, int y, int width, int height)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

x int

The x-coordinate of the upper-left corner of the rectangle to fill.

y int

The y-coordinate of the upper-left corner of the rectangle to fill.

width int

Width of the rectangle to fill.

height int

Height of the rectangle to fill.

Exceptions

ArgumentNullException

brush is null.

FillRectangle(Brush, float, float, float, float)

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

public void FillRectangle(Brush brush, float x, float y, float width, float height)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

x float

The x-coordinate of the upper-left corner of the rectangle to fill.

y float

The y-coordinate of the upper-left corner of the rectangle to fill.

width float

Width of the rectangle to fill.

height float

Height of the rectangle to fill.

Exceptions

ArgumentNullException

brush is null.

FillRectangles(Brush, RectangleF[])

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

public void FillRectangles(Brush brush, RectangleF[] rects)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

rects RectangleF[]

Array of Rectangle structures that represent the rectangles to fill.

Exceptions

ArgumentNullException

brush is null or rects is null.

FillRectangles(Brush, Rectangle[])

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

public void FillRectangles(Brush brush, Rectangle[] rects)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

rects Rectangle[]

Array of Rectangle structures that represent the rectangles to fill.

Exceptions

ArgumentNullException

brush is null or rects is null.

FillRegion(Brush, Region)

Fills the interior of a Region.

public void FillRegion(Brush brush, Region region)

Parameters

brush Brush

Brush that determines the characteristics of the fill.

region Region

Region that represents the area to fill.

Exceptions

ArgumentNullException

brush is null. -or- region is null.

MeasureString(string, Font, SizeF, StringFormat)

Measures the specified text string with specified parameters

public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)

Parameters

text string

The text to measure.

font Font

The font to measure.

layoutArea SizeF

The layout area.

stringFormat StringFormat

The string format.

Returns

SizeF

Size in pixels of measured text string

MultiplyTransform(Matrix)

Multiplies the Matrix that represents the local geometric transform of this Graphics by the specified Matrix by prepending the specified Matrix.

public void MultiplyTransform(Matrix matrix)

Parameters

matrix Matrix

The Matrix by which to multiply the geometric transform.

MultiplyTransform(Matrix, MatrixOrder)

Multiplies the Matrix that represents the local geometric transform of this Graphics by the specified Matrix in the specified order.

public void MultiplyTransform(Matrix matrix, MatrixOrder order)

Parameters

matrix Matrix

The Matrix by which to multiply the geometric transform.

order MatrixOrder

A MatrixOrder that specifies in which order to multiply the two matrices.

ResetTransform()

Resets the Transform property to identity.

public void ResetTransform()

RotateTransform(float)

Rotates the local geometric transform by the specified amount. This method prepends the rotation to the transform.

public void RotateTransform(float angle)

Parameters

angle float

The angle of rotation.

RotateTransform(float, MatrixOrder)

Rotates the local geometric transform by the specified amount in the specified order.

public void RotateTransform(float angle, MatrixOrder order)

Parameters

angle float

The angle of rotation.

order MatrixOrder

A MatrixOrder that specifies whether to append or prepend the rotation matrix.

ScaleTransform(float, float)

Scales the local geometric transform by the specified amounts. This method prepends the scaling matrix to the transform.

public void ScaleTransform(float sx, float sy)

Parameters

sx float

The amount by which to scale the transform in the x-axis direction.

sy float

The amount by which to scale the transform in the y-axis direction.

ScaleTransform(float, float, MatrixOrder)

Scales the local geometric transform by the specified amounts in the specified order.

public void ScaleTransform(float sx, float sy, MatrixOrder order)

Parameters

sx float

The amount by which to scale the transform in the x-axis direction.

sy float

The amount by which to scale the transform in the y-axis direction.

order MatrixOrder

A MatrixOrder that specifies whether to append or prepend the scaling matrix.

TranslateTransform(float, float)

Translates the local geometric transform by the specified dimensions. This method prepends the translation to the transform.

public void TranslateTransform(float dx, float dy)

Parameters

dx float

The value of the translation in x.

dy float

The value of the translation in y.

TranslateTransform(float, float, MatrixOrder)

Translates the local geometric transform by the specified dimensions in the specified order.

public void TranslateTransform(float dx, float dy, MatrixOrder order)

Parameters

dx float

The value of the translation in x.

dy float

The value of the translation in y.

order MatrixOrder

The order (prepend or append) in which to apply the translation.