RT,具体应该怎么操作?
我的思路:用CStdioFile统计有多少行,然后将读取数据存放到结构体中,再从结构体中取出,用MoveTo,LineTo绘制.但在统计行数时,老是断言失败,这是什么原因?请问一下还有没有什么好的思路,比如说读取出来用什么存储比较好?

解决方案 »

  1.   

    文本文数据块是这样的:
    234
    34420006.2080 2948798.5654 1790.000 0
    34420009.2881 2948805.6055 1790.000 0
    .....(有234个点)
    1578
    34420015.3154 2948910.7559 1780.000 0
    34420010.1455 2948910.8652 1780.000 0
    .....(有1578个点)每个整数表示一条线上面所有点数.
    读取到链表,然后MoveTo,LineTo绘制...??求思路 代码..
      

  2.   

    ....一条线上的点数知道的话很简单的POINT atp[234] // 234个点输入进去然后调用一个函数
    Polyline(hdc,apt,234);
    就OK了 比一个一个MoveTo 然后 LineTo效率高多了
      

  3.   

    楼上说的方法很不错,以下摘自MSDN:
    CDC::Polyline
    This method draws a set of line segments connecting the points specified by lpPoints. The lines are drawn from the first point through subsequent points using the current pen.BOOL Polyline( 
    LPPOINT lpPoints, 
    int nCount ); 
    Parameters
    lpPoints 
    Pointer to an array of POINT structures or CPoint objects to connect. 
    nCount 
    The number of points in the array. This value must be at least two. 
    Return Value
    Nonzero if the function is successful; otherwise, it is zero.Res
    Unlike the LineTo method, the Polyline method neither uses nor updates the current position.