MFC CDC::GetPath

CDC::GetPath

int GetPath( LPPOINT lpPoints, LPBYTE lpTypes, int nCount ) const;

返回值

If the nCount parameter is nonzero, the number of points enumerated. If nCount is 0, the total number of points in the path (and GetPath writes nothing to the buffers). If nCount is nonzero and is less than the number of points in the path, the return value is -1.

如果nCount参数非零,则返回列出的点数目。如果nCount为零,则返回路径中的点总数(要求GetPath没有向缓冲区中写入)。如果nCount非零且小于路径中的点数,则返回-1。

参数说明

lpPoints

Points to an array of POINT data structures or CPoint objects where the line endpoints and curve control points are placed.

含有直线端点和曲线控制点的POINT数据结构或CPoint对象的指针。

lpTypes

Points to an array of bytes where the vertex types are placed. Values are one of the following:

放置顶点类型数组的指针。可取下列值之一:

  • PT_MOVETO   Specifies that the corresponding point in lpPoints starts a disjoint figure.

    PT_MOVETO lpPoints中的对应点,开始分解图形。
  • PT_LINETO   Specifies that the previous point and the corresponding point in lpPoints are the endpoints of a line.

    PT_LINETO 指定前一点,lpPoints中的对应点为直线的终点。
  • PT_BEZIERTO   Specifies that the corresponding point in lpPoints is a control point or ending point for a B閦ier curve.

    PT_BEZIERTO lpPonits中的对应点为曲线的控制点或终点。

    PT_BEZIERTO types always occur in sets of three. The point in the path immediately preceding them defines the starting point for the B閦ier curve. The first two PT_BEZIERTO points are the control points, and the third PT_BEZIERTO point is the end point (if hard-coded).

    PT_BEZIERTO类型总是三个一组地出现。路径中的点作为Bezier曲线的起点,前两个PT_BEZIERTO作为控制点,第三个PT_BEZIERTO作为终点。

    PT_LINETO or PT_BEZIERTO type may be combined with the following flag (by using the bitwise operatorOR) to indicate that the corresponding point is the last point in a figure and that the figure should be closed:

    A PT_LINETO或PT_BEZIERTO类型可以用标记符号(如使用位运算符OR)加以联合,表示相应点是图形的最终点,且图形是闭合的。

  • PT_CLOSEFIGURE   Specifies that the figure is automatically closed after the corresponding line or curve is drawn. The figure is closed by drawing a line from the line or curve endpoint to the point corresponding to the last PT_MOVETO.

    PT_CLOSEFIGURE 当对应直线或曲线绘制完成后,图形自动闭合。通过从直线或曲线终点到最后一个PT_MOVETO的对应点画线段的方法来关闭图形。

nCount

Specifies the total number of POINT data structures that may be placed in the lpPoints array. This value must be the same as the number of bytes that may be placed in the lpTypes array.

指定可能放在lpPoint数组中的POINT数据结构的总数。其值与可能放在lpType数组中的字节总数相同。

备注

Retrieves the coordinates defining the endpoints of lines and the control points of curves found in the path that is selected into the device context. The device context must contain a closed path. The points of the path are returned in logical coordinates. Points are stored in the path in device coordinates, so GetPath changes the points from device coordinates to logical coordinates by using the inverse of the current transformation. TheFlattenPath member function may be called before GetPath, to convert all curves in the path into line segments.

获得路径中直线终点和曲线控制点的坐标值,该路径在设备上下文内。设备上下文必须包含一个封闭的路径,路径中的点以逻辑坐标返回。在路径中,点以设备坐标形式存储,因此GetPath用相反的转换方法将设备坐标转换成逻辑坐标,在GetPath之前先调用FlattenPath成员函数,将曲线变成线段。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值