导航:  GdiPlus Classes > GdiPlus Classes > CGpGraphics Class > Graphics Object >

DrawArc

上一页返回章节概述下一页

描述

 

画弧.圆弧是椭圆的一部分.

 

C++ Syntax

 

Status DrawArc(

[in]  const Pen *pen,

[in]  REAL x,

[in]  REAL y,

[in]  REAL width,

[in]  REAL height,

[in]  REAL startAngle,

[in]  REAL sweepAngle

);

 

Status DrawArc(

[in]  const Pen *pen,

[in]  INT x,

[in]  INT y,

[in]  INT width,

[in]  INT height,

[in]  REAL startAngle,

[in]  REAL sweepAngle

);

 

Status DrawArc(

[in]       const Pen *pen,

[in, ref]  const RectF &rect,

[in]       REAL startAngle,

[in]       REAL sweepAngle

);

 

Status DrawArc(

[in]       const Pen *pen,

[in, ref]  const Rect &rect,

[in]       REAL startAngle,

[in]       REAL sweepAngle

);

 

FreeBASIC 语法

 

FUNCTION DrawArc ( _

BYVAL pPen AS CGpPen PTR, _

BYVAL x AS SINGLE, _

BYVAL y AS SINGLE, _

BYVAL nWidth AS SINGLE, _

BYVAL nHeight AS SINGLE, _

BYVAL startAngle AS SINGLE, _

BYVAL sweepAngle AS SINGLE _

) AS LONG

 

FUNCTION DrawArc ( _

BYVAL pPen AS CGpPen PTR, _

BYVAL x AS INT_, _

BYVAL y AS INT_, _

BYVAL nWidth AS INT_, _

BYVAL nHeight AS INT_, _

BYVAL startAngle AS SINGLE, _

BYVAL sweepAngle AS SINGLE _

) AS LONG

 

FUNCTION DrawArc ( _

BYVAL pPen AS CGpPen PTR, _

BYVAL rc AS GpRectF PTR, _

BYVAL startAngle AS SINGLE, _

BYVAL sweepAngle AS SINGLE _

) AS LONG

 

FUNCTION DrawArc ( _

BYVAL pPen AS CGpPen PTR, _

BYVAL rc AS GpRect PTR, _

BYVAL startAngle AS SINGLE, _

BYVAL sweepAngle AS SINGLE _

) AS LONG

 

参数

 

pPen

 

[in]指针的那一支钢笔是用来画弧.

 

x

 

[in]单精度数,指定包含圆弧椭圆的边框左上角的x坐标.

 

y

 

[in]单精度数,指定包含圆弧椭圆的边框左上角的y坐标.

 

nWidth

 

[in]简单精度数,指定包含圆弧椭圆的宽度.

 

nHeight

 

[in]简单精度数,指定包含圆弧椭圆的高度.

 

startAngle

 

[in]简单精度数指定X轴和圆弧的起始点之间的角度.

 

sweepAngle

 

[in]简单精度数指定的开始和结束点之间的弧角.

 

返回值

 

如果该方法成功,则返回Ok,这是对Status枚举元素.

如果这个方法失败,它返回一个枚举的其他元素的Status.

 

引用文件

 

CGpBitmap.inc (include CGdiPlus.inc)

 

示例

 

' ========================================================================================

' The following example draws a 90-degree arc.

' ========================================================================================

SUB Example_DrawArc (BYVAL hdc AS HDC)

 

  ' // Create a graphics object from the window device context

  DIM graphics AS CGpGraphics = hdc

  ' // Get the DPI scaling ratio

  DIM rxRatio AS SINGLE = graphics.GetDpiX / 96

  DIM ryRatio AS SINGLE = graphics.GetDpiY / 96

  ' // Set the scale transform

  graphics.ScaleTransform(rxRatio, ryRatio)

 

  ' // Draw the arc

  DIM redPen AS CGpPen = CGpPen(GDIP_ARGB(255, 255, 0, 0), 3)

  graphics.DrawArc(@redPen, 0, 0, 200, 100, 0.0, 90.0)

 

END SUB

' ========================================================================================