关闭

MFC CDC::GetPath

1211人阅读 评论(0) 收藏 举报

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

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:278450次
    • 积分:2624
    • 等级:
    • 排名:第13926名
    • 原创:51篇
    • 转载:95篇
    • 译文:0篇
    • 评论:12条
    文章分类
    最新评论