通过


Graphics 类

定义

封装 GDI+ 绘图图面。 无法继承此类。

public ref class Graphics sealed : MarshalByRefObject, IDisposable, System::Drawing::IDeviceContext
public ref class Graphics sealed : MarshalByRefObject, IDisposable
public sealed class Graphics : MarshalByRefObject, IDisposable, System.Drawing.IDeviceContext
[System.Runtime.InteropServices.ComVisible(false)]
public sealed class Graphics : MarshalByRefObject, IDisposable
type Graphics = class
    inherit MarshalByRefObject
    interface IDisposable
    interface IDeviceContext
[<System.Runtime.InteropServices.ComVisible(false)>]
type Graphics = class
    inherit MarshalByRefObject
    interface IDisposable
type Graphics = class
    inherit MarshalByRefObject
    interface IDeviceContext
    interface IDisposable
Public NotInheritable Class Graphics
Inherits MarshalByRefObject
Implements IDeviceContext, IDisposable
Public NotInheritable Class Graphics
Inherits MarshalByRefObject
Implements IDisposable
继承
属性
实现

示例

下面的代码示例旨在与 Windows 窗体一起使用,并且需要一个 PaintEventArgs 对象。 该 PaintEventArgs 对象已命名 e ,并且是事件处理程序的参数 Paint 。 该示例执行以下操作:

  • 从 JPEG 文件创建映像。 该文件命名为 SampImag.jpg,位于示例的文件夹中。

  • 创建一个点,用于绘制图像的左上角。

  • 使用 Graphics 对象将未缩放的图像绘制到屏幕。

private:
   void DrawImagePointF( PaintEventArgs^ e )
   {
      // Create image.
      Image^ newImage = Image::FromFile( "SampImag.jpg" );

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

      // Draw image to screen.
      e->Graphics->DrawImage( newImage, ulCorner );
   }
private void DrawImagePointF(PaintEventArgs e)
{
             
    // Create image.
    Image newImage = Image.FromFile("SampImag.jpg");
             
    // Create point for upper-left corner of image.
    PointF ulCorner = new PointF(100.0F, 100.0F);
             
    // Draw image to screen.
    e.Graphics.DrawImage(newImage, ulCorner);
}
Private Sub DrawImagePointF(ByVal e As PaintEventArgs)

    ' Create image.
    Dim newImage As Image = Image.FromFile("SampImag.jpg")

    ' Create point for upper-left corner of image.
    Dim ulCorner As New PointF(100.0F, 100.0F)

    ' Draw image to screen.
    e.Graphics.DrawImage(newImage, ulCorner)
End Sub

注解

Graphics 类提供将对象绘制到显示设备的方法。 A Graphics 与特定设备上下文相关联。

注释

在 .NET 6 及更高版本中,包含此类型的 System.Drawing.Common 包 仅支持在 Windows 操作系统上运行。 在跨平台应用中使用此类型会导致编译时警告和运行时异常。 有关详细信息,请参阅 仅在 Windows 上支持的 System.Drawing.Common。

可以通过对继承自Graphics的对象调用Control.CreateGraphics方法或通过处理控件System.Windows.Forms.Control的事件和访问Control.Paint类的属性Graphics来获取System.Windows.Forms.PaintEventArgs对象。 还可以使用FromImage该方法从图像创建Graphics对象。 有关创建 Graphics 对象的详细信息,请参阅 How to: Create Graphics Objects for Drawing.

可以使用对象绘制许多不同的形状和线条 Graphics 。 有关如何绘制线条和形状的详细信息,请参阅要绘制的线条或形状的特定 Draw图形元素 方法。 这些方法包括DrawLineDrawArcDrawClosedCurveDrawPolygonDrawRectangle。 有关如何绘制线条和形状的详细信息,请参阅 使用笔绘制线条和形状以及使用画笔填充形状

还可以分别使用 DrawImage 和方法绘制图像和 DrawIcon 图标。 若要执行从屏幕到对象绘图面 Graphics 的颜色数据的位块传输,请参阅 CopyFromScreen。 有关如何使用 Graphics 对象绘制图像的详细信息,请参阅 “使用图像”、“位图”、“图标”和“图元文件”。

此外,还可以操作对象使用的 Graphics 坐标系。 有关坐标系及其操作方法的详细信息,请参阅 坐标系和转换

属性

名称 说明
Clip

获取或设置限制此Graphics绘图区域的一个 Region

ClipBounds

获取一个 RectangleF 结构,该结构绑定此 Graphics剪辑区域。

CompositingMode

获取一个值,该值指定如何绘制复合图像。Graphics

CompositingQuality

获取或设置为此 Graphics绘制的复合图像的呈现质量。

DpiX

获取此 Graphics值的水平分辨率。

DpiY

获取此 Graphics值的垂直分辨率。

InterpolationMode

获取或设置与此 Graphics关联的内插模式。

IsClipEmpty

获取一个值,该值指示此 Graphics 剪辑区域是否为空。

IsVisibleClipEmpty

获取一个值,该值指示此 Graphics 区域的可见剪辑区域是否为空。

PageScale

获取或设置此 Graphics单位的世界单位和页面单位之间的缩放。

PageUnit

获取或设置用于此 Graphics页坐标的度量单位。

PixelOffsetMode

获取或设置一个值,该值指定在 Graphics呈现期间像素的偏移方式。

RenderingOrigin

获取或设置此 Graphics 元素的呈现原点,用于分量画笔和阴影画笔。

SmoothingMode

获取或设置此 Graphics内容的呈现质量。

TextContrast

获取或设置呈现文本的伽马更正值。

TextRenderingHint

获取或设置与此 Graphics关联的文本的呈现模式。

Transform

获取或设置此 Graphics几何世界转换的副本。

TransformElements

获取或设置此 Graphics对象的世界转换元素。

VisibleClipBounds

获取此 Graphics可见剪辑区域的边界矩形。

方法

名称 说明
AddMetafileComment(Byte[])

向当前 Metafile添加注释。

BeginContainer()

保存具有当前 Graphics 状态的图形容器,并打开并使用新的图形容器。

BeginContainer(Rectangle, Rectangle, GraphicsUnit)

保存具有当前 Graphics 状态的图形容器,并打开并使用具有指定缩放转换的新图形容器。

BeginContainer(RectangleF, RectangleF, GraphicsUnit)

保存具有当前 Graphics 状态的图形容器,并打开并使用具有指定缩放转换的新图形容器。

Clear(Color)

清除整个绘图图面,并用指定的背景色填充它。

CopyFromScreen(Int32, Int32, Int32, Int32, Size, CopyPixelOperation)

执行与像素矩形相对应的颜色数据的位块传输,从屏幕到绘图图面 Graphics

CopyFromScreen(Int32, Int32, Int32, Int32, Size)

执行与像素矩形相对应的颜色数据的位块传输,从屏幕到绘图图面 Graphics

CopyFromScreen(Point, Point, Size, CopyPixelOperation)

执行与像素矩形相对应的颜色数据的位块传输,从屏幕到绘图图面 Graphics

CopyFromScreen(Point, Point, Size)

执行与像素矩形相对应的颜色数据的位块传输,从屏幕到绘图图面 Graphics

CreateObjRef(Type)

创建一个对象,其中包含生成用于与远程对象通信的代理所需的所有相关信息。

(继承自 MarshalByRefObject)
Dispose()

释放由此 Graphics使用的所有资源。

DrawArc(Pen, Int32, Int32, Int32, Int32, Int32, Int32)

绘制一个弧线,表示由一对坐标、宽度和高度指定的椭圆部分。

DrawArc(Pen, Rectangle, Single, Single)

绘制一个弧线,表示由结构指定的椭圆的一 Rectangle 部分。

DrawArc(Pen, RectangleF, Single, Single)

绘制一个弧线,表示由结构指定的椭圆的一 RectangleF 部分。

DrawArc(Pen, Single, Single, Single, Single, Single, Single)

绘制一个弧线,表示由一对坐标、宽度和高度指定的椭圆部分。

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

绘制由四 Point 个结构定义的贝塞尔样条。

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

绘制由四 PointF 个结构定义的贝塞尔样条。

DrawBezier(Pen, Single, Single, Single, Single, Single, Single, Single, Single)

绘制由表示点的四对有序坐标定义的 Bézier 样条。

DrawBeziers(Pen, Point[])

从结构数组 Point 中绘制一系列贝塞尔样条。

DrawBeziers(Pen, PointF[])

从结构数组 PointF 中绘制一系列贝塞尔样条。

DrawBeziers(Pen, ReadOnlySpan<Point>)

从结构数组 Point 中绘制一系列贝塞尔样条。

DrawBeziers(Pen, ReadOnlySpan<PointF>)

从结构数组 Point 中绘制一系列贝塞尔样条。

DrawCachedBitmap(CachedBitmap, Int32, Int32)

绘制给定 cachedBitmap的 。

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

绘制由使用指定紧张结构数组 Point 定义的闭合基线样条。

DrawClosedCurve(Pen, Point[])

绘制由结构数组 Point 定义的闭合基样条。

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

绘制由使用指定紧张结构数组 PointF 定义的闭合基线样条。

DrawClosedCurve(Pen, PointF[])

绘制由结构数组 PointF 定义的闭合基样条。

DrawClosedCurve(Pen, ReadOnlySpan<Point>, Single, FillMode)

绘制由使用指定紧张结构数组 PointF 定义的闭合基线样条。

DrawClosedCurve(Pen, ReadOnlySpan<Point>)

绘制由使用指定紧张结构数组 PointF 定义的闭合基线样条。

DrawClosedCurve(Pen, ReadOnlySpan<PointF>, Single, FillMode)

绘制由使用指定紧张结构数组 PointF 定义的闭合基线样条。

DrawClosedCurve(Pen, ReadOnlySpan<PointF>)

绘制由使用指定紧张结构数组 PointF 定义的闭合基线样条。

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

使用指定的紧张度通过指定的结构数组 Point 绘制基数样线。

DrawCurve(Pen, Point[], Single)

使用指定的紧张度通过指定的结构数组 Point 绘制基数样线。

DrawCurve(Pen, Point[])

通过指定的结构数组绘制基数样条 Point

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

使用指定的紧张度通过指定的结构数组 PointF 绘制基数样线。 绘图从数组的开头开始偏移。

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

通过指定的结构数组绘制基数样条 PointF 。 绘图从数组的开头开始偏移。

DrawCurve(Pen, PointF[], Single)

使用指定的紧张度通过指定的结构数组 PointF 绘制基数样线。

DrawCurve(Pen, PointF[])

通过指定的结构数组绘制基数样条 PointF

DrawCurve(Pen, ReadOnlySpan<Point>, Int32, Int32, Single)

使用指定的紧张度通过指定的结构数组 Point 绘制基数样线。

DrawCurve(Pen, ReadOnlySpan<Point>, Single)

使用指定的紧张度通过指定的结构数组 Point 绘制基数样线。

DrawCurve(Pen, ReadOnlySpan<Point>)

使用指定的紧张度通过指定的结构数组 Point 绘制基数样线。

DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32, Single)

使用指定的紧张度通过指定的结构数组 Point 绘制基数样线。

DrawCurve(Pen, ReadOnlySpan<PointF>, Int32, Int32)

使用指定的紧张度通过指定的结构数组 Point 绘制基数样线。

DrawCurve(Pen, ReadOnlySpan<PointF>, Single)

使用指定的紧张度通过指定的结构数组 Point 绘制基数样线。

DrawCurve(Pen, ReadOnlySpan<PointF>)

使用指定的紧张度通过指定的结构数组 Point 绘制基数样线。

DrawEllipse(Pen, Int32, Int32, Int32, Int32)

绘制由矩形左上角、高度和宽度的坐标指定的边界矩形定义的椭圆。

DrawEllipse(Pen, Rectangle)

绘制由边界 Rectangle 结构指定的椭圆。

DrawEllipse(Pen, RectangleF)

绘制由边界 RectangleF定义的椭圆。

DrawEllipse(Pen, Single, Single, Single, Single)

绘制由一对坐标、高度和宽度指定的边界矩形定义的椭圆。

DrawIcon(Icon, Int32, Int32)

绘制由指定坐标处指定的 Icon 图像。

DrawIcon(Icon, Rectangle)

绘制由结构指定的区域内指定的IconRectangle图像。

DrawIconUnstretched(Icon, Rectangle)

在不缩放图像的情况下绘制由指定 Icon 表示的图像。

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

应用指定效果后绘制图像的一部分。

DrawImage(Image, Effect)

应用指定效果后绘制图像的一部分。

DrawImage(Image, Int32, Int32, Int32, Int32)

绘制 Image 位于指定位置且大小为指定大小的指定值。

DrawImage(Image, Int32, Int32, Rectangle, GraphicsUnit)

在指定位置绘制图像的一部分。

DrawImage(Image, Int32, Int32)

使用其原始物理大小在坐标对指定的位置绘制指定的图像。

DrawImage(Image, Point)

使用指定位置的原始物理大小绘制指定的 Image对象。

DrawImage(Image, Point[], Rectangle, GraphicsUnit, ImageAttributes, Graphics+DrawImageAbort, Int32)

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, Point[], Rectangle, GraphicsUnit, ImageAttributes, Graphics+DrawImageAbort)

绘制指定位置的指定 Image 部分,并指定大小。

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

绘制指定位置的指定 Image 部分。

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

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, Point[])

绘制指定位置以及具有指定形状和大小的指定 Image 位置。

DrawImage(Image, PointF)

使用指定位置的原始物理大小绘制指定的 Image对象。

DrawImage(Image, PointF[], RectangleF, GraphicsUnit, ImageAttributes, Graphics+DrawImageAbort, Int32)

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, PointF[], RectangleF, GraphicsUnit, ImageAttributes, Graphics+DrawImageAbort)

绘制指定位置的指定 Image 部分,并指定大小。

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

绘制指定位置的指定 Image 部分,并指定大小。

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

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, PointF[])

绘制指定位置以及具有指定形状和大小的指定 Image 位置。

DrawImage(Image, Rectangle, Int32, Int32, Int32, Int32, GraphicsUnit, ImageAttributes, Graphics+DrawImageAbort, IntPtr)

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, Rectangle, Int32, Int32, Int32, Int32, GraphicsUnit, ImageAttributes, Graphics+DrawImageAbort)

绘制指定位置的指定 Image 部分,并指定大小。

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

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, Rectangle, Int32, Int32, Int32, Int32, GraphicsUnit)

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, Rectangle, Rectangle, GraphicsUnit)

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, Rectangle, Single, Single, Single, Single, GraphicsUnit, ImageAttributes, Graphics+DrawImageAbort, IntPtr)

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, Rectangle, Single, Single, Single, Single, GraphicsUnit, ImageAttributes, Graphics+DrawImageAbort)

绘制指定位置的指定 Image 部分,并指定大小。

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

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, Rectangle, Single, Single, Single, Single, GraphicsUnit)

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, Rectangle)

绘制 Image 位于指定位置且大小为指定大小的指定值。

DrawImage(Image, RectangleF, RectangleF, GraphicsUnit)

绘制指定位置的指定 Image 部分,并指定大小。

DrawImage(Image, RectangleF)

绘制 Image 位于指定位置且大小为指定大小的指定值。

DrawImage(Image, Single, Single, RectangleF, GraphicsUnit)

在指定位置绘制图像的一部分。

DrawImage(Image, Single, Single, Single, Single)

绘制 Image 位于指定位置且大小为指定大小的指定值。

DrawImage(Image, Single, Single)

使用指定位置的原始物理大小绘制指定的 Image对象。

DrawImageUnscaled(Image, Int32, Int32, Int32, Int32)

使用指定位置的原始物理大小绘制指定图像。

DrawImageUnscaled(Image, Int32, Int32)

使用其原始物理大小在坐标对指定的位置绘制指定的图像。

DrawImageUnscaled(Image, Point)

使用指定位置的原始物理大小绘制指定图像。

DrawImageUnscaled(Image, Rectangle)

使用指定位置的原始物理大小绘制指定图像。

DrawImageUnscaledAndClipped(Image, Rectangle)

在不缩放的情况下绘制指定的图像,并根据需要进行剪辑以容纳在指定的矩形中。

DrawLine(Pen, Int32, Int32, Int32, Int32)

绘制连接坐标对指定的两个点的线条。

DrawLine(Pen, Point, Point)

绘制连接两 Point 个结构的线条。

DrawLine(Pen, PointF, PointF)

绘制连接两 PointF 个结构的线条。

DrawLine(Pen, Single, Single, Single, Single)

绘制连接坐标对指定的两个点的线条。

DrawLines(Pen, Point[])

绘制连接结构数组的 Point 一系列线段。

DrawLines(Pen, PointF[])

绘制连接结构数组的 PointF 一系列线段。

DrawLines(Pen, ReadOnlySpan<Point>)

绘制连接结构数组的 Point 一系列线段。

DrawLines(Pen, ReadOnlySpan<PointF>)

绘制连接结构数组的 Point 一系列线段。

DrawPath(Pen, GraphicsPath)

绘制一个 GraphicsPath

DrawPie(Pen, Int32, Int32, Int32, Int32, Int32, Int32)

绘制由坐标对、宽度、高度和两条径向线指定的椭圆定义的饼图。

DrawPie(Pen, Rectangle, Single, Single)

绘制由结构指定的椭圆和两条径向线定义的 Rectangle 饼图。

DrawPie(Pen, RectangleF, Single, Single)

绘制由结构指定的椭圆和两条径向线定义的 RectangleF 饼图。

DrawPie(Pen, Single, Single, Single, Single, Single, Single)

绘制由坐标对、宽度、高度和两条径向线指定的椭圆定义的饼图。

DrawPolygon(Pen, Point[])

绘制由结构数组 Point 定义的多边形。

DrawPolygon(Pen, PointF[])

绘制由结构数组 PointF 定义的多边形。

DrawPolygon(Pen, ReadOnlySpan<Point>)

绘制由结构数组 Point 定义的多边形。

DrawPolygon(Pen, ReadOnlySpan<PointF>)

绘制由结构数组 Point 定义的多边形。

DrawRectangle(Pen, Int32, Int32, Int32, Int32)

绘制由坐标对、宽度和高度指定的矩形。

DrawRectangle(Pen, Rectangle)

绘制由 Rectangle 结构指定的矩形。

DrawRectangle(Pen, RectangleF)

绘制指定矩形的轮廓。

DrawRectangle(Pen, Single, Single, Single, Single)

绘制由坐标对、宽度和高度指定的矩形。

DrawRectangles(Pen, ReadOnlySpan<Rectangle>)

绘制由 Rectangle 结构指定的一系列矩形。

DrawRectangles(Pen, ReadOnlySpan<RectangleF>)

绘制由 Rectangle 结构指定的一系列矩形。

DrawRectangles(Pen, Rectangle[])

绘制由 Rectangle 结构指定的一系列矩形。

DrawRectangles(Pen, RectangleF[])

绘制由 RectangleF 结构指定的一系列矩形。

DrawRoundedRectangle(Pen, Rectangle, Size)

绘制指定圆角矩形的轮廓。

DrawRoundedRectangle(Pen, RectangleF, SizeF)

绘制指定圆角矩形的轮廓。

DrawString(ReadOnlySpan<Char>, Font, Brush, PointF, StringFormat)

使用指定StringFormat对象的格式属性在指定位置Brush绘制指定的文本字符串和Font对象。

DrawString(ReadOnlySpan<Char>, Font, Brush, PointF)

使用指定 Brush 对象 Font 在指定位置绘制指定的文本字符串。

DrawString(ReadOnlySpan<Char>, Font, Brush, RectangleF, StringFormat)

使用指定StringFormat对象的格式属性在指定的矩形Brush中绘制指定的文本字符串和Font对象。

DrawString(ReadOnlySpan<Char>, Font, Brush, RectangleF)

使用指定的矩形和Font对象绘制指定矩形中的指定Brush文本字符串。

DrawString(ReadOnlySpan<Char>, Font, Brush, Single, Single, StringFormat)

使用指定StringFormat对象的格式属性在指定位置Brush绘制指定的文本字符串和Font对象。

DrawString(ReadOnlySpan<Char>, Font, Brush, Single, Single)

使用指定 Brush 对象 Font 在指定位置绘制指定的文本字符串。

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

使用指定StringFormat对象的格式属性在指定位置Brush绘制指定的文本字符串和Font对象。

DrawString(String, Font, Brush, PointF)

使用指定 Brush 对象 Font 在指定位置绘制指定的文本字符串。

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

使用指定StringFormat对象的格式属性在指定的矩形Brush中绘制指定的文本字符串和Font对象。

DrawString(String, Font, Brush, RectangleF)

使用指定的矩形和Font对象绘制指定矩形中的指定Brush文本字符串。

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

使用指定StringFormat对象的格式属性在指定位置Brush绘制指定的文本字符串和Font对象。

DrawString(String, Font, Brush, Single, Single)

使用指定 Brush 对象 Font 在指定位置绘制指定的文本字符串。

EndContainer(GraphicsContainer)

关闭当前图形容器,并将此 Graphics 状态还原到调用 BeginContainer() 方法所保存的状态。

EnumerateMetafile(Metafile, Point, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将指定 Metafile中的记录一次发送到回调方法,以使用指定的图像属性在指定点显示。

EnumerateMetafile(Metafile, Point, Graphics+EnumerateMetafileProc, IntPtr)

将指定 Metafile中的记录一次发送到一个回调方法,以便在指定点显示。

EnumerateMetafile(Metafile, Point, Graphics+EnumerateMetafileProc)

将指定 Metafile中的记录一次发送到一个回调方法,以便在指定点显示。

EnumerateMetafile(Metafile, Point, Rectangle, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

使用指定的图像属性,将所选矩形中的记录从一 Metafile个一个矩形中的记录发送到在指定点显示的回调方法。

EnumerateMetafile(Metafile, Point, Rectangle, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr)

将所选矩形中的记录从 Metafile一个、一次一个的记录发送到一个回调方法,以便在指定点显示。

EnumerateMetafile(Metafile, Point, Rectangle, GraphicsUnit, Graphics+EnumerateMetafileProc)

将所选矩形中的记录从 Metafile一个、一次一个的记录发送到一个回调方法,以便在指定点显示。

EnumerateMetafile(Metafile, Point[], Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将指定 Metafile中的记录一次发送到回调方法,以使用指定的图像属性在指定的并行影像中显示。

EnumerateMetafile(Metafile, Point[], Graphics+EnumerateMetafileProc, IntPtr)

将指定 Metafile中的记录一次发送到回调方法,以便在指定的并行影像中显示。

EnumerateMetafile(Metafile, Point[], Graphics+EnumerateMetafileProc)

将指定 Metafile中的记录一次发送到回调方法,以便在指定的并行影像中显示。

EnumerateMetafile(Metafile, Point[], Rectangle, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将所选矩形中的记录从 Metafile一个矩形一次一个发送到回调方法,以使用指定的图像属性在指定的并行影像中显示。

EnumerateMetafile(Metafile, Point[], Rectangle, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr)

将所选矩形中的记录从 Metafile一个、一次一个的记录发送到回调方法,以便在指定的平行影像中显示。

EnumerateMetafile(Metafile, Point[], Rectangle, GraphicsUnit, Graphics+EnumerateMetafileProc)

将所选矩形中的记录从 Metafile一个、一次一个的记录发送到回调方法,以便在指定的平行影像中显示。

EnumerateMetafile(Metafile, PointF, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将指定 Metafile中的记录一次发送到回调方法,以使用指定的图像属性在指定点显示。

EnumerateMetafile(Metafile, PointF, Graphics+EnumerateMetafileProc, IntPtr)

将指定 Metafile中的记录一次发送到一个回调方法,以便在指定点显示。

EnumerateMetafile(Metafile, PointF, Graphics+EnumerateMetafileProc)

将指定 Metafile中的记录一次发送到一个回调方法,以便在指定点显示。

EnumerateMetafile(Metafile, PointF, RectangleF, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

使用指定的图像属性,将所选矩形中的记录从一 Metafile个一个矩形中的记录发送到在指定点显示的回调方法。

EnumerateMetafile(Metafile, PointF, RectangleF, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr)

将所选矩形中的记录从 Metafile一个、一次一个的记录发送到一个回调方法,以便在指定点显示。

EnumerateMetafile(Metafile, PointF, RectangleF, GraphicsUnit, Graphics+EnumerateMetafileProc)

将所选矩形中的记录从 Metafile一个、一次一个的记录发送到一个回调方法,以便在指定点显示。

EnumerateMetafile(Metafile, PointF[], Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将指定 Metafile中的记录一次发送到回调方法,以使用指定的图像属性在指定的并行影像中显示。

EnumerateMetafile(Metafile, PointF[], Graphics+EnumerateMetafileProc, IntPtr)

将指定 Metafile中的记录一次发送到回调方法,以便在指定的并行影像中显示。

EnumerateMetafile(Metafile, PointF[], Graphics+EnumerateMetafileProc)

将指定 Metafile中的记录一次发送到回调方法,以便在指定的并行影像中显示。

EnumerateMetafile(Metafile, PointF[], RectangleF, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将所选矩形中的记录从 Metafile一个矩形一次一个发送到回调方法,以使用指定的图像属性在指定的并行影像中显示。

EnumerateMetafile(Metafile, PointF[], RectangleF, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr)

将所选矩形中的记录从 Metafile一个、一次一个的记录发送到回调方法,以便在指定的平行影像中显示。

EnumerateMetafile(Metafile, PointF[], RectangleF, GraphicsUnit, Graphics+EnumerateMetafileProc)

将所选矩形中的记录从 Metafile一个、一次一个的记录发送到回调方法,以便在指定的平行影像中显示。

EnumerateMetafile(Metafile, Rectangle, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将指定 Metafile记录一次一个发送到回调方法,以使用指定的图像属性在指定的矩形中显示。

EnumerateMetafile(Metafile, Rectangle, Graphics+EnumerateMetafileProc, IntPtr)

将指定 Metafile记录一次一个发送到回调方法,以便在指定的矩形中显示。

EnumerateMetafile(Metafile, Rectangle, Graphics+EnumerateMetafileProc)

将指定 Metafile记录一次一个发送到回调方法,以便在指定的矩形中显示。

EnumerateMetafile(Metafile, Rectangle, Rectangle, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将所选矩形的记录从一 Metafile个(一次一个)发送到回调方法,以使用指定的图像属性在指定矩形中显示。

EnumerateMetafile(Metafile, Rectangle, Rectangle, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr)

将所选矩形的记录从一 Metafile次一个矩形发送到一个回调方法,以便在指定的矩形中显示。

EnumerateMetafile(Metafile, Rectangle, Rectangle, GraphicsUnit, Graphics+EnumerateMetafileProc)

将所选矩形的记录从一 Metafile次一个矩形发送到一个回调方法,以便在指定的矩形中显示。

EnumerateMetafile(Metafile, RectangleF, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将指定 Metafile记录一次一个发送到回调方法,以使用指定的图像属性在指定的矩形中显示。

EnumerateMetafile(Metafile, RectangleF, Graphics+EnumerateMetafileProc, IntPtr)

将指定 Metafile记录一次一个发送到回调方法,以便在指定的矩形中显示。

EnumerateMetafile(Metafile, RectangleF, Graphics+EnumerateMetafileProc)

将指定 Metafile记录一次一个发送到回调方法,以便在指定的矩形中显示。

EnumerateMetafile(Metafile, RectangleF, RectangleF, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr, ImageAttributes)

将所选矩形的记录从一 Metafile个(一次一个)发送到回调方法,以使用指定的图像属性在指定矩形中显示。

EnumerateMetafile(Metafile, RectangleF, RectangleF, GraphicsUnit, Graphics+EnumerateMetafileProc, IntPtr)

将所选矩形的记录从一 Metafile次一个矩形发送到一个回调方法,以便在指定的矩形中显示。

EnumerateMetafile(Metafile, RectangleF, RectangleF, GraphicsUnit, Graphics+EnumerateMetafileProc)

将所选矩形的记录从一 Metafile次一个矩形发送到一个回调方法,以便在指定的矩形中显示。

Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
ExcludeClip(Rectangle)

更新此 Graphics 剪辑区域以排除结构 Rectangle 指定的区域。

ExcludeClip(Region)

更新此 Graphics 剪辑区域以排除由 a Region.

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

使用指定的填充模式和紧张度填充由一组 Point 结构定义的封闭基线曲线的内部。

FillClosedCurve(Brush, Point[], FillMode)

使用指定的填充模式填充由结构数组 Point 定义的封闭基线曲线的内部。

FillClosedCurve(Brush, Point[])

填充由结构数组 Point 定义的封闭基样线曲线的内部。

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

使用指定的填充模式和紧张度填充由一组 PointF 结构定义的封闭基线曲线的内部。

FillClosedCurve(Brush, PointF[], FillMode)

使用指定的填充模式填充由结构数组 PointF 定义的封闭基线曲线的内部。

FillClosedCurve(Brush, PointF[])

填充由结构数组 PointF 定义的封闭基样线曲线的内部。

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode, Single)

使用指定的填充模式和紧张度填充由一组 PointF 结构定义的封闭基线曲线的内部。

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode)

使用指定的填充模式和紧张度填充由一组 PointF 结构定义的封闭基线曲线的内部。

FillClosedCurve(Brush, ReadOnlySpan<Point>)

使用指定的填充模式和紧张度填充由一组 PointF 结构定义的封闭基线曲线的内部。

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode, Single)

使用指定的填充模式和紧张度填充由一组 PointF 结构定义的封闭基线曲线的内部。

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode)

使用指定的填充模式和紧张度填充由一组 PointF 结构定义的封闭基线曲线的内部。

FillClosedCurve(Brush, ReadOnlySpan<PointF>)

使用指定的填充模式和紧张度填充由一组 PointF 结构定义的封闭基线曲线的内部。

FillEllipse(Brush, Int32, Int32, Int32, Int32)

填充由一对坐标、宽度和高度指定的边界矩形定义的椭圆的内部。

FillEllipse(Brush, Rectangle)

填充由结构指定的 Rectangle 边框定义的椭圆的内部。

FillEllipse(Brush, RectangleF)

填充由结构指定的 RectangleF 边框定义的椭圆的内部。

FillEllipse(Brush, Single, Single, Single, Single)

填充由一对坐标、宽度和高度指定的边界矩形定义的椭圆的内部。

FillPath(Brush, GraphicsPath)

填充一个 GraphicsPath.

FillPie(Brush, Int32, Int32, Int32, Int32, Int32, Int32)

填充由一对坐标、宽度、高度和两条径向线指定的椭圆定义的饼图部分的内部。

FillPie(Brush, Rectangle, Single, Single)

填充由结构指定的椭圆和两条径向线定义的 RectangleF 饼图部分的内部。

FillPie(Brush, RectangleF, Single, Single)

填充椭圆和两条径向线定义的饼图部分的内部。

FillPie(Brush, Single, Single, Single, Single, Single, Single)

填充由一对坐标、宽度、高度和两条径向线指定的椭圆定义的饼图部分的内部。

FillPolygon(Brush, Point[], FillMode)

使用指定的填充模式填充由结构指定的 Point 点数组定义的多边形的内部。

FillPolygon(Brush, Point[])

填充由结构指定的 Point 点数组定义的多边形的内部。

FillPolygon(Brush, PointF[], FillMode)

使用指定的填充模式填充由结构指定的 PointF 点数组定义的多边形的内部。

FillPolygon(Brush, PointF[])

填充由结构指定的 PointF 点数组定义的多边形的内部。

FillPolygon(Brush, ReadOnlySpan<Point>, FillMode)

使用指定的填充模式填充由结构指定的 Point 点数组定义的多边形的内部。

FillPolygon(Brush, ReadOnlySpan<Point>)

使用指定的填充模式填充由结构指定的 Point 点数组定义的多边形的内部。

FillPolygon(Brush, ReadOnlySpan<PointF>, FillMode)

使用指定的填充模式填充由结构指定的 Point 点数组定义的多边形的内部。

FillPolygon(Brush, ReadOnlySpan<PointF>)

使用指定的填充模式填充由结构指定的 Point 点数组定义的多边形的内部。

FillRectangle(Brush, Int32, Int32, Int32, Int32)

填充由一对坐标、宽度和高度指定的矩形的内部。

FillRectangle(Brush, Rectangle)

填充由结构指定的 Rectangle 矩形的内部。

FillRectangle(Brush, RectangleF)

填充由结构指定的 RectangleF 矩形的内部。

FillRectangle(Brush, Single, Single, Single, Single)

填充由一对坐标、宽度和高度指定的矩形的内部。

FillRectangles(Brush, ReadOnlySpan<Rectangle>)

填充由结构指定的 RectangleF 一系列矩形的内部。

FillRectangles(Brush, ReadOnlySpan<RectangleF>)

填充由结构指定的 RectangleF 一系列矩形的内部。

FillRectangles(Brush, Rectangle[])

填充由结构指定的 Rectangle 一系列矩形的内部。

FillRectangles(Brush, RectangleF[])

填充由结构指定的 RectangleF 一系列矩形的内部。

FillRegion(Brush, Region)

填充一个 Region.

FillRoundedRectangle(Brush, Rectangle, Size)

用一个圆角矩形 Brush的内侧填充 。

FillRoundedRectangle(Brush, RectangleF, SizeF)

用一个圆角矩形 Brush的内侧填充 。

Finalize()

允许对象在垃圾回收回收资源之前尝试释放资源并执行其他清理操作。

Flush()

强制执行所有挂起的图形操作,并立即返回,而无需等待操作完成。

Flush(FlushIntention)

强制执行所有挂起的图形操作,方法等待或未等待(如指定)以在操作完成之前返回。

FromHdc(IntPtr, IntPtr)

从指定句柄创建设备 Graphics 上下文和设备句柄的新句柄。

FromHdc(IntPtr)

Graphics从指定句柄创建设备上下文的新句柄。

FromHdcInternal(IntPtr)

返回指定设备上下文的 a Graphics

FromHwnd(IntPtr)

创建从指定句柄到窗口的新 Graphics 句柄。

FromHwndInternal(IntPtr)

为指定的窗口句柄创建新的 Graphics 窗口句柄。

FromImage(Image)

从指定的Image值创建一个新Graphics项。

GetContextInfo()
已过时.

获取累积图形上下文。

GetContextInfo(PointF, Region)

获取累积偏移量和剪辑区域。

GetContextInfo(PointF)

获取累积偏移量。

GetHalftonePalette()

获取当前 Windows 半色调调色板的句柄。

GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetHdc()

获取与此 Graphics关联的设备上下文的句柄。

GetLifetimeService()
已过时.

检索控制此实例的生存期策略的当前生存期服务对象。

(继承自 MarshalByRefObject)
GetNearestColor(Color)

获取指定 Color 结构最接近的颜色。

GetType()

获取当前实例的 Type

(继承自 Object)
InitializeLifetimeService()
已过时.

获取生存期服务对象来控制此实例的生存期策略。

(继承自 MarshalByRefObject)
IntersectClip(Rectangle)

将此 Graphics 剪辑区域的剪辑区域更新为当前剪辑区域和指定 Rectangle 结构的交集。

IntersectClip(RectangleF)

将此 Graphics 剪辑区域的剪辑区域更新为当前剪辑区域和指定 RectangleF 结构的交集。

IntersectClip(Region)

将此 Graphics 剪辑区域更新为当前剪辑区域的交集和指定的 Region剪辑区域。

IsVisible(Int32, Int32, Int32, Int32)

指示由一对坐标、宽度和高度指定的矩形是否包含在此 Graphics可见的剪辑区域中。

IsVisible(Int32, Int32)

指示由一对坐标指定的点是否包含在此 Graphics可见剪辑区域中。

IsVisible(Point)

指示指定的 Point 结构是否包含在此 Graphics可见的剪辑区域中。

IsVisible(PointF)

指示指定的 PointF 结构是否包含在此 Graphics可见的剪辑区域中。

IsVisible(Rectangle)

指示结构指定的 Rectangle 矩形是否包含在此 Graphics可见的剪辑区域中。

IsVisible(RectangleF)

指示结构指定的 RectangleF 矩形是否包含在此 Graphics可见的剪辑区域中。

IsVisible(Single, Single, Single, Single)

指示由一对坐标、宽度和高度指定的矩形是否包含在此 Graphics可见的剪辑区域中。

IsVisible(Single, Single)

指示由一对坐标指定的点是否包含在此 Graphics可见剪辑区域中。

MeasureCharacterRanges(ReadOnlySpan<Char>, Font, RectangleF, StringFormat)

获取对象数组 Region ,其中每个对象都绑定指定字符串中的字符位置范围。

MeasureCharacterRanges(String, Font, RectangleF, StringFormat)

获取对象数组 Region ,其中每个对象都绑定指定字符串中的字符位置范围。

MeasureString(ReadOnlySpan<Char>, Font, Int32, StringFormat)

用指定的 Font 字符串绘制并用指定的格式绘制时度量指定的 StringFormat字符串。

MeasureString(ReadOnlySpan<Char>, Font, Int32)

用指定的字符串绘制时度量指定的 Font字符串。

MeasureString(ReadOnlySpan<Char>, Font, PointF, StringFormat)

用指定的 Font 字符串绘制并用指定的格式绘制时度量指定的 StringFormat字符串。

MeasureString(ReadOnlySpan<Char>, Font, SizeF, StringFormat, Int32, Int32)

用指定的 Font 字符串绘制并用指定的格式绘制时度量指定的 StringFormat字符串。

MeasureString(ReadOnlySpan<Char>, Font, SizeF, StringFormat)

用指定的 Font 字符串绘制并用指定的格式绘制时度量指定的 StringFormat字符串。

MeasureString(ReadOnlySpan<Char>, Font, SizeF)

用指定布局区域中的指定 Font 对象绘制时度量指定的字符串。

MeasureString(ReadOnlySpan<Char>, Font)

用指定的字符串绘制时度量指定的 Font字符串。

MeasureString(String, Font, Int32, StringFormat)

用指定的 Font 字符串绘制并用指定的格式绘制时度量指定的 StringFormat字符串。

MeasureString(String, Font, Int32)

用指定的字符串绘制时度量指定的 Font字符串。

MeasureString(String, Font, PointF, StringFormat)

用指定的 Font 字符串绘制并用指定的格式绘制时度量指定的 StringFormat字符串。

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

用指定的 Font 字符串绘制并用指定的格式绘制时度量指定的 StringFormat字符串。

MeasureString(String, Font, SizeF, StringFormat)

用指定的 Font 字符串绘制并用指定的格式绘制时度量指定的 StringFormat字符串。

MeasureString(String, Font, SizeF)

用指定布局区域中的指定 Font 对象绘制时度量指定的字符串。

MeasureString(String, Font)

用指定的字符串绘制时度量指定的 Font字符串。

MeasureStringInternal(ReadOnlySpan<Char>, Font, RectangleF, StringFormat, Int32, Int32)

封装 GDI+ 绘图图面。 无法继承此类。

MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。

(继承自 MarshalByRefObject)
MultiplyTransform(Matrix, MatrixOrder)

将这 Graphics 一点的世界转换相乘,并按指定顺序指定 Matrix

MultiplyTransform(Matrix)

将这 Graphics 一点的世界转换相乘并指定 Matrix

ReleaseHdc()

释放之前调用 GetHdc() 此方法 Graphics获取的设备上下文句柄。

ReleaseHdc(IntPtr)

释放之前调用 GetHdc() 此方法 Graphics获取的设备上下文句柄。

ReleaseHdcInternal(IntPtr)

释放设备上下文的句柄。

ResetClip()

将此剪辑区域 Graphics 重置为无限区域。

ResetTransform()

将此属性 Graphics 的世界转换矩阵重置为标识矩阵。

Restore(GraphicsState)

将此状态 Graphics 还原到由 a GraphicsState. 表示的状态。

RotateTransform(Single, MatrixOrder)

按指定顺序将指定的旋转应用于此 Graphics 转换矩阵。

RotateTransform(Single)

将指定的旋转应用于此 Graphics转换矩阵。

Save()

保存此 Graphics 状态,并使用 a GraphicsState.

ScaleTransform(Single, Single, MatrixOrder)

按指定顺序将指定的缩放操作应用于此 Graphics 的转换矩阵。

ScaleTransform(Single, Single)

通过将指定的缩放操作追加到对象的转换矩阵,将其应用于此 Graphics 矩阵的转换矩阵。

SetClip(Graphics, CombineMode)

将此 Graphics 区域的剪辑区域设置为当前剪辑区域的指定组合操作和 Clip 指定 Graphics属性的结果。

SetClip(Graphics)

将此 Graphics 区域的剪辑区域设置为 Clip 指定的 Graphics属性。

SetClip(GraphicsPath, CombineMode)

将此 Graphics 区域的剪辑区域设置为组合当前剪辑区域和指定 GraphicsPath操作的结果。

SetClip(GraphicsPath)

将此 Graphics 区域的剪辑区域设置为指定的 GraphicsPath

SetClip(Rectangle, CombineMode)

将此 Graphics 区域的剪辑区域设置为将当前剪辑区域与结构指定的矩形组合在一 Rectangle 起的指定操作的结果。

SetClip(Rectangle)

将此 Graphics 区域的剪辑区域设置为结构指定的 Rectangle 矩形。

SetClip(RectangleF, CombineMode)

将此 Graphics 区域的剪辑区域设置为将当前剪辑区域与结构指定的矩形组合在一 RectangleF 起的指定操作的结果。

SetClip(RectangleF)

将此 Graphics 区域的剪辑区域设置为结构指定的 RectangleF 矩形。

SetClip(Region, CombineMode)

将此 Graphics 区域的剪辑区域设置为组合当前剪辑区域和指定 Region操作的结果。

ToString()

返回一个表示当前对象的字符串。

(继承自 Object)
TransformPoints(CoordinateSpace, CoordinateSpace, Point[])

使用当前世界和页面转换 Graphics将点数组从一个坐标空间转换为另一个坐标空间。

TransformPoints(CoordinateSpace, CoordinateSpace, PointF[])

使用当前世界和页面转换 Graphics将点数组从一个坐标空间转换为另一个坐标空间。

TransformPoints(CoordinateSpace, CoordinateSpace, ReadOnlySpan<Point>)

使用当前世界和页面转换 Graphics将点数组从一个坐标空间转换为另一个坐标空间。

TransformPoints(CoordinateSpace, CoordinateSpace, ReadOnlySpan<PointF>)

使用当前世界和页面转换 Graphics将点数组从一个坐标空间转换为另一个坐标空间。

TranslateClip(Int32, Int32)

按水平方向和垂直方向的指定量转换此 Graphics 剪辑区域。

TranslateClip(Single, Single)

按水平方向和垂直方向的指定量转换此 Graphics 剪辑区域。

TranslateTransform(Single, Single, MatrixOrder)

通过将指定的平移应用于指定顺序的转换 Graphics 矩阵来更改坐标系的原点。

TranslateTransform(Single, Single)

通过将指定的转换前面追加到此 Graphics转换矩阵来更改坐标系的原点。

适用于

另请参阅