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 IDeviceContext
    interface IDisposable
type Graphics = class
    inherit MarshalByRefObject
    interface IDisposable
    interface IDeviceContext
[<System.Runtime.InteropServices.ComVisible(false)>]
type Graphics = class
    inherit MarshalByRefObject
    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 提供用于将对象绘制到显示设备的方法。 与 Graphics 特定设备上下文关联。

注意

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

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

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

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

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

属性

Clip

获取或设置 Region,它限定此 Graphics 的绘图区域。

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)

执行颜色数据(对应于由像素组成的矩形)从屏幕到 Graphics 的绘图图面的位块传输。

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

执行颜色数据(对应于由像素组成的矩形)从屏幕到 Graphics 的绘图图面的位块传输。

CopyFromScreen(Point, Point, Size)

执行颜色数据(对应于由像素组成的矩形)从屏幕到 Graphics 的绘图图面的位块传输。

CopyFromScreen(Point, Point, Size, CopyPixelOperation)

执行颜色数据(对应于由像素组成的矩形)从屏幕到 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)

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

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

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

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

绘制由四个表示点的有序坐标对定义的贝塞尔样条。

DrawBeziers(Pen, Point[])

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

DrawBeziers(Pen, PointF[])

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

DrawBeziers(Pen, ReadOnlySpan<Point>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawBeziers(Pen, ReadOnlySpan<PointF>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawCachedBitmap(CachedBitmap, Int32, Int32)

绘制给定 cachedBitmap的 。

DrawClosedCurve(Pen, Point[])

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

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

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

DrawClosedCurve(Pen, PointF[])

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

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

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

DrawClosedCurve(Pen, ReadOnlySpan<Point>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawClosedCurve(Pen, ReadOnlySpan<PointF>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawCurve(Pen, Point[])

绘制经过一组指定的 Point 结构的基数样条。

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

使用指定的张力绘制经过一组指定的 Point 结构的基数样条。

DrawCurve(Pen, Point[], Single)

使用指定的张力绘制经过一组指定的 Point 结构的基数样条。

DrawCurve(Pen, PointF[])

绘制经过一组指定的 PointF 结构的基数样条。

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

绘制经过一组指定的 PointF 结构的基数样条。 从相对于数组开始位置的偏移量开始绘制。

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

使用指定的张力绘制经过一组指定的 PointF 结构的基数样条。 从相对于数组开始位置的偏移量开始绘制。

DrawCurve(Pen, PointF[], Single)

使用指定的张力绘制经过一组指定的 PointF 结构的基数样条。

DrawCurve(Pen, ReadOnlySpan<Point>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawCurve(Pen, ReadOnlySpan<Point>, Single)

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawCurve(Pen, ReadOnlySpan<PointF>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawCurve(Pen, ReadOnlySpan<PointF>, Single)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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)

Icon 结构指定的区域内绘制指定的 Rectangle 表示的图像。

DrawIconUnstretched(Icon, Rectangle)

绘制指定的 Icon 表示的图像,而不缩放该图像。

DrawImage(Image, Effect)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawImage(Image, Int32, Int32)

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

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

在指定位置并且按指定大小绘制指定的 Image

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

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

DrawImage(Image, Point)

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

DrawImage(Image, Point[])

在指定位置并且按指定形状和大小绘制指定的 Image

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

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

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

DrawImage(Image, PointF)

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

DrawImage(Image, PointF[])

在指定位置并且按指定形状和大小绘制指定的 Image

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

DrawImage(Image, Rectangle)

在指定位置并且按指定大小绘制指定的 Image

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

DrawImage(Image, Rectangle, Rectangle, GraphicsUnit)

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

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

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

DrawImage(Image, RectangleF)

在指定位置并且按指定大小绘制指定的 Image

DrawImage(Image, RectangleF, RectangleF, GraphicsUnit)

在指定位置并且按指定大小绘制指定的 Image 的指定部分。

DrawImage(Image, Single, Single)

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

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

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

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

在指定位置并且按指定大小绘制指定的 Image

DrawImageUnscaled(Image, Int32, Int32)

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

DrawImageUnscaled(Image, Int32, Int32, 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>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawLines(Pen, ReadOnlySpan<PointF>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawPolygon(Pen, ReadOnlySpan<PointF>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

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

DrawRectangle(Pen, Rectangle)

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

DrawRectangle(Pen, RectangleF)

绘制指定矩形的轮廓。

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

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

DrawRectangles(Pen, ReadOnlySpan<Rectangle>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawRectangles(Pen, ReadOnlySpan<RectangleF>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawRectangles(Pen, Rectangle[])

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

DrawRectangles(Pen, RectangleF[])

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

DrawRoundedRectangle(Pen, Rectangle, Size)

封装一个 GDI+ 绘图图面。 此类不能被继承。

DrawRoundedRectangle(Pen, RectangleF, SizeF)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

在指定位置并且用指定的 BrushFont 对象绘制指定的文本字符串。

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

使用指定 Brush 的格式化特性,用指定的 FontStringFormat 对象在指定的位置绘制指定的文本字符串。

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

在指定矩形并且用指定的 BrushFont 对象绘制指定的文本字符串。

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

使用指定 Brush 的格式化特性,用指定的 FontStringFormat 对象在指定的矩形中绘制指定的文本字符串。

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

在指定位置并且用指定的 BrushFont 对象绘制指定的文本字符串。

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

使用指定 Brush 的格式化特性,用指定的 FontStringFormat 对象在指定的位置绘制指定的文本字符串。

DrawString(String, Font, Brush, PointF)

在指定位置并且用指定的 BrushFont 对象绘制指定的文本字符串。

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

使用指定 Brush 的格式化特性,用指定的 FontStringFormat 对象在指定的位置绘制指定的文本字符串。

DrawString(String, Font, Brush, RectangleF)

在指定矩形并且用指定的 BrushFont 对象绘制指定的文本字符串。

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

使用指定 Brush 的格式化特性,用指定的 FontStringFormat 对象在指定的矩形中绘制指定的文本字符串。

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

在指定位置并且用指定的 BrushFont 对象绘制指定的文本字符串。

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

使用指定 Brush 的格式化特性,用指定的 FontStringFormat 对象在指定的位置绘制指定的文本字符串。

EndContainer(GraphicsContainer)

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

EnumerateMetafile(Metafile, Point, Graphics+EnumerateMetafileProc)

将指定 Metafile 中的记录逐个发送到回调方法以在指定的点处显示。

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

将指定 Metafile 中的记录逐个发送到回调方法以在指定的点处显示。

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

将指定 Metafile 中的记录逐个发送到回调方法,以在指定的点处用指定的图像特性显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的点处显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的点处显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法,以在指定的点处用指定的图像特性显示。

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

将指定 Metafile 中的记录逐个发送到回调方法以在指定的平行四边形中显示。

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

将指定 Metafile 中的记录逐个发送到回调方法以在指定的平行四边形中显示。

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

将指定 Metafile 中的记录逐个发送到回调方法,以在指定的平行四边形中用指定的图像特性显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的平行四边形中显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的平行四边形中显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法,以在指定的平行四边形中用指定的图像特性显示。

EnumerateMetafile(Metafile, PointF, Graphics+EnumerateMetafileProc)

将指定 Metafile 中的记录逐个发送到回调方法以在指定的点处显示。

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

将指定 Metafile 中的记录逐个发送到回调方法以在指定的点处显示。

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

将指定 Metafile 中的记录逐个发送到回调方法,以在指定的点处用指定的图像特性显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的点处显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的点处显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法,以在指定的点处用指定的图像特性显示。

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

将指定 Metafile 中的记录逐个发送到回调方法以在指定的平行四边形中显示。

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

将指定 Metafile 中的记录逐个发送到回调方法以在指定的平行四边形中显示。

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

将指定 Metafile 中的记录逐个发送到回调方法,以在指定的平行四边形中用指定的图像特性显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的平行四边形中显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的平行四边形中显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法,以在指定的平行四边形中用指定的图像特性显示。

EnumerateMetafile(Metafile, Rectangle, Graphics+EnumerateMetafileProc)

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

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

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

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

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

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的矩形中显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的矩形中显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法,以在指定的矩形中用指定的图像特性显示。

EnumerateMetafile(Metafile, RectangleF, Graphics+EnumerateMetafileProc)

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

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

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

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

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

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的矩形中显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法以在指定的矩形中显示。

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

Metafile 中选定矩形内的记录逐个发送到回调方法,以在指定的矩形中用指定的图像特性显示。

Equals(Object)

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

(继承自 Object)
ExcludeClip(Rectangle)

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

ExcludeClip(Region)

更新此 Graphics 的剪辑区域,以排除 Region 所指定的区域。

FillClosedCurve(Brush, Point[])

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

FillClosedCurve(Brush, Point[], FillMode)

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

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

使用指定的填充模式和张力填充 Point 结构数组定义的闭合基数样条曲线的内部。

FillClosedCurve(Brush, PointF[])

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

FillClosedCurve(Brush, PointF[], FillMode)

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

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

使用指定的填充模式和张力填充 PointF 结构数组定义的闭合基数样条曲线的内部。

FillClosedCurve(Brush, ReadOnlySpan<Point>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

封装一个 GDI+ 绘图图面。 此类不能被继承。

FillClosedCurve(Brush, ReadOnlySpan<PointF>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

封装一个 GDI+ 绘图图面。 此类不能被继承。

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[])

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

FillPolygon(Brush, Point[], FillMode)

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

FillPolygon(Brush, PointF[])

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

FillPolygon(Brush, PointF[], FillMode)

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

FillPolygon(Brush, ReadOnlySpan<Point>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

FillPolygon(Brush, ReadOnlySpan<Point>, FillMode)

封装一个 GDI+ 绘图图面。 此类不能被继承。

FillPolygon(Brush, ReadOnlySpan<PointF>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

FillPolygon(Brush, ReadOnlySpan<PointF>, FillMode)

封装一个 GDI+ 绘图图面。 此类不能被继承。

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

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

FillRectangle(Brush, Rectangle)

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

FillRectangle(Brush, RectangleF)

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

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

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

FillRectangles(Brush, ReadOnlySpan<Rectangle>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

FillRectangles(Brush, ReadOnlySpan<RectangleF>)

封装一个 GDI+ 绘图图面。 此类不能被继承。

FillRectangles(Brush, Rectangle[])

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

FillRectangles(Brush, RectangleF[])

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

FillRegion(Brush, Region)

填充 Region 的内部。

FillRoundedRectangle(Brush, Rectangle, Size)

封装一个 GDI+ 绘图图面。 此类不能被继承。

FillRoundedRectangle(Brush, RectangleF, SizeF)

封装一个 GDI+ 绘图图面。 此类不能被继承。

Finalize()

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

Flush()

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

Flush(FlushIntention)

用此方法强制执行所有挂起的图形操作,按照指定,等待或者不等待,在操作完成之前返回。

FromHdc(IntPtr)

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

FromHdc(IntPtr, IntPtr)

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

FromHdcInternal(IntPtr)

返回指定设备上下文的 Graphics

FromHwnd(IntPtr)

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

FromHwndInternal(IntPtr)

创建指定 Windows 句柄的新 Graphics

FromImage(Image)

从指定的 Graphics 创建新的 Image

GetContextInfo()
已过时.

获取累积的图形上下文。

GetContextInfo(PointF)

获取累积偏移量。

GetContextInfo(PointF, Region)

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

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)

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

IsVisible(Int32, Int32, Int32, Int32)

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

IsVisible(Point)

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

IsVisible(PointF)

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

IsVisible(Rectangle)

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

IsVisible(RectangleF)

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

IsVisible(Single, Single)

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

IsVisible(Single, Single, Single, Single)

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

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

获取 Region 对象的数组,其中每个对象将字符位置的范围限定在指定字符串内。

MeasureCharacterRanges(String, Font, RectangleF, StringFormat)

获取 Region 对象的数组,其中每个对象将字符位置的范围限定在指定字符串内。

MeasureString(ReadOnlySpan<Char>, Font)

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

MeasureString(ReadOnlySpan<Char>, Font, Int32)

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

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

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

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

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

MeasureString(ReadOnlySpan<Char>, Font, SizeF)

当在指定的布局区域内以指定的 Font 绘制时,测量指定的字符串。

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

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

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

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

MeasureString(String, Font)

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

MeasureString(String, Font, Int32)

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

MeasureString(String, Font, Int32, StringFormat)

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

MeasureString(String, Font, PointF, StringFormat)

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

MeasureString(String, Font, SizeF)

当在指定的布局区域内以指定的 Font 绘制时,测量指定的字符串。

MeasureString(String, Font, SizeF, StringFormat)

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

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

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

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

封装一个 GDI+ 绘图图面。 此类不能被继承。

MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
MemberwiseClone(Boolean)

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

(继承自 MarshalByRefObject)
MultiplyTransform(Matrix)

将此 Graphics 的世界转换乘以指定的 Matrix

MultiplyTransform(Matrix, MatrixOrder)

以指定顺序将此 Graphics 的世界转换乘以指定的 Matrix

ReleaseHdc()

释放通过以前对此 GetHdc()Graphics 方法的调用获得的设备上下文句柄。

ReleaseHdc(IntPtr)

释放通过以前对此 GetHdc()Graphics 方法的调用获得的设备上下文句柄。

ReleaseHdcInternal(IntPtr)

释放设备上下文的句柄。

ResetClip()

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

ResetTransform()

将此 Graphics 的世界变换矩阵重置为单位矩阵。

Restore(GraphicsState)

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

RotateTransform(Single)

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

RotateTransform(Single, MatrixOrder)

以指定顺序将指定旋转应用到此 Graphics 的变换矩阵。

Save()

保存此 Graphics 的当前状态,并用 GraphicsState 标识保存的状态。

ScaleTransform(Single, Single)

将指定的缩放操作应用于此 Graphics 的转换矩阵,方法是将该对象的转换矩阵左乘该缩放矩阵。

ScaleTransform(Single, Single, MatrixOrder)

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

SetClip(Graphics)

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

SetClip(Graphics, CombineMode)

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

SetClip(GraphicsPath)

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

SetClip(GraphicsPath, CombineMode)

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

SetClip(Rectangle)

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

SetClip(Rectangle, CombineMode)

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

SetClip(RectangleF)

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

SetClip(RectangleF, CombineMode)

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

SetClip(Region, CombineMode)

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

ToString()

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

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

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

TransformPoints(CoordinateSpace, CoordinateSpace, PointF[])

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

TranslateClip(Int32, Int32)

将此 Graphics 的剪辑区域沿水平方向和垂直方向平移指定的量。

TranslateClip(Single, Single)

将此 Graphics 的剪辑区域沿水平方向和垂直方向平移指定的量。

TranslateTransform(Single, Single)

通过使此 Graphics 的转换矩阵左乘指定的平移来更改坐标系统的原点。

TranslateTransform(Single, Single, MatrixOrder)

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

适用于

另请参阅