这个对象是Graphics2D以及Wmf公用的基础类型
GDICanvas
00 Remarks
the gdi+ graphics canvas base model
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| DrawBézier | 1 | Draws a Bézier spline defined by four System.Drawing.Point structures. |
| DrawEllipse | 1 | Draws an ellipse defined by a bounding rectangle specified by a pair of coordinates, a height, and a width. |
| DrawImage | 3 | Draws the specified System.Drawing.Image, using its original physical size, at the specified location. |
| DrawImageUnscaled | 3 | Draws a specified image using its original physical size at a specified location. |
| DrawImageUnscaledAndClipped | 1 | Draws the specified image without scaling and clips it, if necessary, to fit in the specified rectangle. |
| DrawLine | 2 | Draws a line connecting two Point structures. |
| DrawPolygon | 1 | Draws a polygon defined by an array of System.Drawing.PointF structures. |
| DrawRectangle | 1 | Draws a rectangle specified by a System.Drawing.Rectangle structure. |
| DrawString | 2 | Draws the specified text string at the specified location with the specified Brush and Font objects. |
| FillEllipse | 2 | Fills the interior of an ellipse defined by a bounding rectangle specified by a System.Drawing.RectangleF structure. |
| FillPath | 1 | Fills the interior of a System.Drawing.Drawing2D.GraphicsPath. |
| FillPie | 1 | 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. |
| FillRectangle | 1 | Fills the interior of a rectangle specified by a System.Drawing.Rectangle structure. |
| Flush | 1 | Forces execution of all pending graphics operations and returns immediately without waiting for the operations to finish. |
| ResetClip | 1 | Resets the clip region of this System.Drawing.Graphics to an infinite region. |
| ResetTransform | 1 | Resets the world transformation matrix of this System.Drawing.Graphics to the identity matrix. |
| RotateTransform | 1 | Applies the specified rotation to the transformation matrix of this System.Drawing.Graphics. |
| ScaleTransform | 1 | Applies the specified scaling operation to the transformation matrix of this System.Drawing.Graphics by prepending it to the object's transformation matrix. |
| TranslateTransform | 1 | Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this System.Drawing.Graphics. |
| MeasureString | 2 | Measures the specified string when drawn with the specified IGraphics.Font. |
| ReleaseHandle | 1 | Releases all resources used by this GDICanvas.Graphics. |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| Graphics | 1 | GDI+ device handle.(GDI+绘图设备句柄) |
04 Members
Pen, Point, Point, Point, Point)Draws a Bézier spline defined by four System.Drawing.Point structures.
| Name | Type | Description |
|---|---|---|
pen | Pen | System.Drawing.Pen structure that determines the color, width, and style of the curve. |
pt1 | Point | System.Drawing.Point structure that represents the starting point of the curve. |
pt2 | Point | System.Drawing.Point structure that represents the first control point for the curve. |
pt3 | Point | System.Drawing.Point structure that represents the second control point for the curve. |
pt4 | Point | System.Drawing.Point structure that represents the ending point of the curve. |
Pen, Single, Single, Single, Single)Draws an ellipse defined by a bounding rectangle specified by a pair of coordinates, a height, and a width.
| Name | Type | Description |
|---|---|---|
pen | Pen | System.Drawing.Pen that determines the color, width, and style of the ellipse. |
x | Single | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
y | Single | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
width | Single | Width of the bounding rectangle that defines the ellipse. |
height | Single | Height of the bounding rectangle that defines the ellipse. |
Image, Point)Draws the specified System.Drawing.Image, using its original physical size, at the specified location.
| Name | Type | Description |
|---|---|---|
image | Image | System.Drawing.Image to draw. |
point | Point | System.Drawing.Point structure that represents the location of the upper-left corner of the drawn image. |
Image, Int32, Int32, Int32, Int32)Draws the specified Image at the specified location and with the specified size.
| Name | Type | Description |
|---|---|---|
image | Image | System.Drawing.Image to draw. |
x | Int32 | The x-coordinate of the upper-left corner of the drawn image. |
y | Int32 | The y-coordinate of the upper-left corner of the drawn image. |
width | Int32 | Width of the drawn image. |
height | Int32 | Height of the drawn image. |
Image, Int32, Int32, Int32, Int32)Draws the specified Image at the specified location and with the specified size.
| Name | Type | Description |
|---|---|---|
image | Image | System.Drawing.Image to draw. |
x | Int32 | The x-coordinate of the upper-left corner of the drawn image. |
y | Int32 | The y-coordinate of the upper-left corner of the drawn image. |
width | Int32 | Width of the drawn image. |
height | Int32 | Height of the drawn image. |
Image, Point)Draws a specified image using its original physical size at a specified location.
| Name | Type | Description |
|---|---|---|
image | Image |
|
point | Point |
|
Image, Int32, Int32)Draws the specified image using its original physical size at the location specified by a coordinate pair.
| Name | Type | Description |
|---|---|---|
image | Image | System.Drawing.Image to draw. |
x | Int32 | The x-coordinate of the upper-left corner of the drawn image. |
y | Int32 | The y-coordinate of the upper-left corner of the drawn image. |
Image, Int32, Int32, Int32, Int32)Draws a specified image using its original physical size at a specified location.
| Name | Type | Description |
|---|---|---|
image | Image |
|
x | Int32 | The x-coordinate of the upper-left corner of the drawn image. |
y | Int32 | The y-coordinate of the upper-left corner of the drawn image. |
width | Int32 | - |
height | Int32 | - |
Image, Rectangle)Draws the specified image without scaling and clips it, if necessary, to fit in the specified rectangle.
| Name | Type | Description |
|---|---|---|
image | Image | The |
rect | Rectangle | The |
Pen, Point, Point)Draws a line connecting two Point structures.
| Name | Type | Description |
|---|---|---|
pen | Pen |
|
pt1 | Point |
|
pt2 | Point |
|
Pen, PointF, PointF)Draws a line connecting two System.Drawing.PointF structures.
| Name | Type | Description |
|---|---|---|
pen | Pen | System.Drawing.Pen that determines the color, width, and style of the line. |
pt1 | PointF | System.Drawing.PointF structure that represents the first point to connect. |
pt2 | PointF | System.Drawing.PointF structure that represents the second point to connect. |
Pen, PointF())Draws a polygon defined by an array of System.Drawing.PointF structures.
| Name | Type | Description |
|---|---|---|
pen | Pen | System.Drawing.Pen that determines the color, width, and style of the polygon. |
points | PointF() | Array of System.Drawing.PointF structures that represent the vertices of the polygon. |
Pen, Rectangle)Draws a rectangle specified by a System.Drawing.Rectangle structure.
| Name | Type | Description |
|---|---|---|
pen | Pen | A System.Drawing.Pen that determines the color, width, and style of the rectangle. |
rect | Rectangle | A System.Drawing.Rectangle structure that represents the rectangle to draw. |
String, Font, Brush, RectangleF)Draws the specified text string in the specified rectangle with the specified System.Drawing.Brush and System.Drawing.Font objects.
| Name | Type | Description |
|---|---|---|
s | String | String to draw. |
font | Font | System.Drawing.Font that defines the text format of the string. |
brush | Brush | System.Drawing.Brush that determines the color and texture of the drawn text. |
layoutRectangle | RectangleF | System.Drawing.RectangleF structure that specifies the location of the drawn text. |
String, Font, Brush, PointF)Draws the specified text string at the specified location with the specified Brush and Font objects.
| Name | Type | Description |
|---|---|---|
s | String | String to draw. |
font | Font | System.Drawing.Font that defines the text format of the string. |
brush | Brush | System.Drawing.Brush that determines the color and texture of the drawn text. |
point | PointF | System.Drawing.PointF structure that specifies the upper-left corner of the drawn text. |
Brush, RectangleF)Fills the interior of an ellipse defined by a bounding rectangle specified by a System.Drawing.RectangleF structure.
| Name | Type | Description |
|---|---|---|
brush | Brush | System.Drawing.Brush that determines the characteristics of the fill. |
rect | RectangleF | System.Drawing.RectangleF structure that represents the bounding rectangle that defines the ellipse. |
Brush, Single, Single, Single, Single)Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.
| Name | Type | Description |
|---|---|---|
brush | Brush | System.Drawing.Brush that determines the characteristics of the fill. |
x | Single | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
y | Single | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse. |
width | Single | Width of the bounding rectangle that defines the ellipse. |
height | Single | Height of the bounding rectangle that defines the ellipse. |
Brush, GraphicsPath)Fills the interior of a System.Drawing.Drawing2D.GraphicsPath.
| Name | Type | Description |
|---|---|---|
brush | Brush | System.Drawing.Brush that determines the characteristics of the fill. |
path | GraphicsPath | System.Drawing.Drawing2D.GraphicsPath that represents the path to fill. |
Brush, Single, Single, Single, Single, Single, Single)Fills the interior of a pie section defined by an ellipse specified by a pair of coordinates, a width, a height, and two radial lines.
| Name | Type | Description |
|---|---|---|
brush | Brush | System.Drawing.Brush that determines the characteristics of the fill. |
x | Single | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
y | Single | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
width | Single | Width of the bounding rectangle that defines the ellipse from which the pie section comes. |
height | Single | Height of the bounding rectangle that defines the ellipse from which the pie section comes. |
startAngle | Single | Angle in degrees measured clockwise from the x-axis to the first side of the pie section. |
sweepAngle | Single | Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section. |
Brush, Rectangle)Fills the interior of a rectangle specified by a System.Drawing.Rectangle structure.
| Name | Type | Description |
|---|---|---|
brush | Brush | System.Drawing.Brush that determines the characteristics of the fill. |
rect | Rectangle | System.Drawing.Rectangle structure that represents the rectangle to fill. |
Forces execution of all pending graphics operations and returns immediately without waiting for the operations to finish.
Resets the clip region of this System.Drawing.Graphics to an infinite region.
Resets the world transformation matrix of this System.Drawing.Graphics to the identity matrix.
Single)Applies the specified rotation to the transformation matrix of this System.Drawing.Graphics.
| Name | Type | Description |
|---|---|---|
angle | Single | Angle of rotation in degrees. |
Single, Single)Applies the specified scaling operation to the transformation matrix of this System.Drawing.Graphics by prepending it to the object's transformation matrix.
| Name | Type | Description |
|---|---|---|
sx | Single | Scale factor in the x direction. |
sy | Single | Scale factor in the y direction. |
Single, Single)Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this System.Drawing.Graphics.
| Name | Type | Description |
|---|---|---|
dx | Single | The x-coordinate of the translation. |
dy | Single | The y-coordinate of the translation. |
String, Font)Measures the specified string when drawn with the specified IGraphics.Font.
| Name | Type | Description |
|---|---|---|
text | String | String to measure. |
font | Font |
|
This method returns a System.Drawing.SizeF structure that represents the size, in the units specified by the Graphics.PageUnit property, of the string specified by the text parameter as drawn with the font parameter.
String)Using IGraphics.Font
| Name | Type | Description |
|---|---|---|
text | String | - |
Releases all resources used by this GDICanvas.Graphics.
GDI+ device handle.(GDI+绘图设备句柄)