Graphics
System.Drawing.Graphics
Namespace: System.Drawing
Assembly: System.Drawing.Managed (4.0.0.0)
Encapsulates a GDI+ drawing surface.
public class Graphics : MarshalByRefObject, IDisposablePublic Class Graphics
Inherits MarshalByRefObject
Implements IDisposableProperties
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.
dstRect
Rectangle structure that, together with the srcRect parameter, specifies a scale transformation for the container.
srcRect
Rectangle structure that, together with the dstRect parameter, specifies a scale transformation for the container.
unit
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.
dstRect
RectangleF structure that, together with the srcRect parameter, specifies a scale transformation for the container.
srcRect
RectangleF structure that, together with the dstRect parameter, specifies a scale transformation for the container.
unit
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.
Dispose()
DrawArc(pen, x, y, width, height, startAngle, sweepAngle)
Draws an arc from the specified ellipse.
startAngle
Angle in degrees measured clockwise from the x-axis to the starting point of the arc.
sweepAngle
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.
startAngle
Angle in degrees measured clockwise from the x-axis to the starting point of the arc.
sweepAngle
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.
startAngle
Angle in degrees measured clockwise from the x-axis to the starting point of the arc.
sweepAngle
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.
startAngle
Angle in degrees measured clockwise from the x-axis to the starting point of the arc.
sweepAngle
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.
Throws:
ArgumentNullException pen is .
DrawBezier(pen, pt1, pt2, pt3, pt4)
Draws a Bezier spline defined by four PointF structures.
DrawBezier(pen, pt1, pt2, pt3, pt4)
Draws a Bezier spline defined by four Point structures.
DrawBeziers(pen, points)
Draws a series of cubic Bezier curves from an array of points.
DrawBeziers(pen, points)
Draws a series of cubic Bezier curves from an array of points.
DrawClosedCurve(pen, points)
Draws a closed curve defined by an array of points.
DrawClosedCurve(pen, points, tension)
Draws a closed curve defined by an array of points.
DrawClosedCurve(pen, points)
Draws a closed curve defined by an array of points.
DrawClosedCurve(pen, points, tension)
Draws a closed curve defined by an array of points.
DrawCurve(pen, points)
Draws a curve defined by an array of points.
DrawCurve(pen, points, tension)
Draws a curve defined by an array of points.
tension
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.
offset
The index of the element in the points array that is used as the first point in the curve.
numberOfSegments
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.
offset
The index of the element in the points array that is used as the first point in the curve.
numberOfSegments
The number of segments used to draw the curve. A segment can be thought of as a line connecting two points.
tension
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.
DrawCurve(pen, points, tension)
Draws a curve defined by an array of points.
tension
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.
offset
The index of the element in the points array that is used as the first point in the curve.
numberOfSegments
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.
offset
The index of the element in the points array that is used as the first point in the curve.
numberOfSegments
The number of segments used to draw the curve. A segment can be thought of as a line connecting two points.
tension
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.
DrawEllipse(pen, x, y, width, height)
Draws the outline of an ellipse defined by a bounding rectangle.
x
The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.
y
The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.
DrawEllipse(pen, rect)
Draws the outline of an ellipse specified by a bounding Rectangle structure.
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.
DrawImage(image, point)
Draws the specified image at the specified location.
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.
Throws:
ArgumentNullException image is .
DrawImage(image, rect)
Draws the specified Image at the specified location and with the specified size.
Throws:
ArgumentNullException image is .
DrawImage(image, x, y, width, height)
Draws the specified Image at the specified location and with the specified size.
Throws:
ArgumentNullException image is .
DrawImage(image, point)
Draws the specified Image, using its original physical size, at the specified location.
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.
Throws:
ArgumentNullException image is .
DrawImage(image, rect)
Draws the specified Image at the specified location and with the specified size.
Throws:
ArgumentNullException image is .
DrawImage(image, x, y, width, height)
Draws the specified Image at the specified location and with the specified size.
Throws:
ArgumentNullException image is .
DrawImage(image, destPoints)
Draws the specified portion of the specified Image at the specified location and with the specified size.
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.
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.
srcUnit
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.
srcUnit
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.
destRect
RectangleF structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.
srcUnit
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.
destRect
Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.
srcUnit
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.
srcUnit
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.
srcUnit
Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.
imageAttr
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.
srcUnit
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.
srcUnit
Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.
imageAttr
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.
destRect
Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.
srcUnit
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.
destRect
Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.
srcUnit
Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.
imageAttr
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.
destRect
Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.
srcUnit
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.
destRect
Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.
srcUnit
Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.
imageAttr
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.
Throws:
ArgumentNullException image is
DrawImageUnscaled(image, x, y, width, height)
Draws a specified image using its original physical size at a specified location.
Throws:
ArgumentNullException image is
DrawImageUnscaled(image, point)
Draws a specified image using its original physical size at a specified location.
Throws:
ArgumentNullException image is
DrawImageUnscaled(image, rect)
Draws a specified image using its original physical size at a specified location.
Throws:
ArgumentNullException image is
DrawImageUnscaledAndClipped(image, rect)
Draws the specified image without scaling and clips it, if necessary, to fit in the specified rectangle.
Throws:
ArgumentException image is .
DrawLine(pen, x1, y1, x2, y2)
Draws a line connecting the two points specified by the coordinate pairs.
Throws:
ArgumentNullException pen is .
DrawLine(pen, x1, y1, x2, y2)
Draws a line connecting the two points specified by the coordinate pairs.
Throws:
ArgumentNullException pen is .
DrawLine(pen, pt1, pt2)
Draws a line connecting two PointF structures.
DrawLine(pen, pt1, pt2)
Draws a line connecting two PointF structures.
DrawLines(pen, points)
Draws a series of line segments that connect an array of points.
DrawLines(pen, points)
Draws a series of line segments that connect an array of points.
DrawPath(pen, path)
Draws a GraphicsPath.
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.
rect
RectangleF structure that represents the bounding rectangle that defines the ellipse from which the pie shape comes.
startAngle
Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.
sweepAngle
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.
x
The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.
y
The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.
height
Height of the bounding rectangle that defines the ellipse from which the pie shape comes.
startAngle
Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.
sweepAngle
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.
rect
Rectangle structure that represents the bounding rectangle that defines the ellipse from which the pie shape comes.
startAngle
Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.
sweepAngle
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.
x
The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.
y
The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.
height
Height of the bounding rectangle that defines the ellipse from which the pie shape comes.
startAngle
Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.
sweepAngle
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.
DrawPolygon(pen, points)
Draws the outline of a polygon defined by an array of points.
DrawRectangle(pen, rect)
Draws the outline of a RectangleF rectangle specified by rect .
DrawRectangle(pen, rect)
Draws the outline of a Rectangle rectangle specified by rect .
DrawRectangle(pen, x, y, width, height)
Draws a rectangle specified by a coordinate pair, a width, and a height.
DrawRectangle(pen, x, y, width, height)
Draws a rectangle specified by a coordinate pair, a width, and a height.
DrawRectangles(pen, rects)
Draws a series of rectangles specified by RectangleF structures.
DrawRectangles(pen, rects)
Draws a series of rectangles specified by Rectangle structures.
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.
DrawString(s, font, brush, point)
Draws the specified text string at the specified location with the specified Brush and Font objects.
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.
format
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.
format
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.
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.
format
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.
FillClosedCurve(brush, points)
Fills the interior of a closed curve defined by an array of points.
FillClosedCurve(brush, points, tension)
Fills the interior of a closed curve defined by an array of points.
FillClosedCurve(brush, points, fillMode)
Fills the interior of a closed curve defined by an array of points.
FillClosedCurve(brush, points, fillMode, tension)
Fills the interior of a closed curve defined by an array of points.
FillClosedCurve(brush, points)
Fills the interior of a closed curve defined by an array of points.
FillClosedCurve(brush, points, tension)
Fills the interior of a closed curve defined by an array of points.
FillClosedCurve(brush, points, fillMode)
Fills the interior of a closed curve defined by an array of points.
FillClosedCurve(brush, points, fillMode, tension)
Fills the interior of a closed curve defined by an array of points.
FillEllipse(brush, rect)
Fills the interior of an ellipse defined by a bounding rectangle specified by a Rectangle structure.
FillEllipse(brush, rect)
Fills the interior of an ellipse defined by a bounding rectangle specified by a RectangleF structure.
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.
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.
x
The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.
y
The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.
FillPath(brush, path)
Fills the interior of a GraphicsPath.
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.
rect
Rectangle structure that represents the bounding rectangle that defines the ellipse from which the pie section comes.
startAngle
Angle in degrees measured clockwise from the x-axis to the first side of the pie section.
sweepAngle
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.
rect
RectangleF structure that represents the bounding rectangle that defines the ellipse from which the pie section comes.
startAngle
Angle in degrees measured clockwise from the x-axis to the first side of the pie section.
sweepAngle
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.
x
The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.
y
The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.
width
Width of the bounding rectangle that defines the ellipse from which the pie section comes.
height
Height of the bounding rectangle that defines the ellipse from which the pie section comes.
startAngle
Angle in degrees measured clockwise from the x-axis to the first side of the pie section.
sweepAngle
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.
x
The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.
y
The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.
width
Width of the bounding rectangle that defines the ellipse from which the pie section comes.
height
Height of the bounding rectangle that defines the ellipse from which the pie section comes.
startAngle
Angle in degrees measured clockwise from the x-axis to the first side of the pie section.
sweepAngle
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.
FillPolygon(brush, points)
Fills the interior of a polygon defined by an array of points.
FillRectangle(brush, rect)
Fills the interior of a rectangle specified by a RectangleF structure with a Brush.
FillRectangle(brush, rect)
Fills the interior of a rectangle specified by a Rectangle structure with a Brush,
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
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
Throws:
ArgumentNullException brush is .
FillRectangles(brush, rects)
Fills the interiors of a series of rectangles with a Brush.
FillRectangles(brush, rects)
Fills the interiors of a series of rectangles with a Brush.
FillRegion(brush, region)
Fills the interior of a Region.
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.
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.
format
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.
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.
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.
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.
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.
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.
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 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.
RotateTransform(angle, order)
Applies the specified rotation to the transformation matrix of this Graphics in the specified order.
order
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.
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.
order
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.
SetClip(rect)
Sets the clipping region of this Graphics to the rectangle specified by a Rectangle structure.
SetClip(graphicsPath)
Sets the clipping region of this Graphics to the specified GraphicsPath.
SetClip(g)
Sets the clipping region of this Graphics to the Clip property of the specified Graphics.
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.
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.
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.
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.
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.
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.
TranslateTransform(dx, dy, order)
Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this Graphics.
order
Member of the MatrixOrder enumeration that specifies whether the translation is prepended or appended to the transformation matrix.
Last updated
Was this helpful?