//获得点的坐标
int X=0;
int Y=1;
//获得点的个数
int number=ds.Tables[0].Rows.Count;
Point[] points=new Point[number];
//将获得的点放进point[]数组中
for(int i=number;X<i;X++)
{

int pointX=System.Convert.ToInt32(ds.Tables[0].Rows[X].ItemArray[Y]);
int pointY=System.Convert.ToInt32(ds.Tables[0].Rows[X].ItemArray[Y+1]);
points[i]=new Point(new Point(pointX,pointY));
    
}请高手指点一下,怎么才能把这些点放进数组中????非常感谢了

解决方案 »

  1.   

    用近似于hashtable的方法,比如用线性表达式得到一个值,用的时候用逆表达式求初始坐标值
      

  2.   

    我是想把这些点放进point[]中,然后把这些点连起来
      

  3.   

    .
    .
    .
    for(;X<number;X++)
    {

    int pointX=System.Convert.ToInt32(ds.Tables[0].Rows[X].ItemArray[Y]);
    int pointY=System.Convert.ToInt32(ds.Tables[0].Rows[X].ItemArray[Y+1]);
    points[X]=new Point(new Point(pointX,pointY));
        
    }
      

  4.   

    这样不行
    无法从“System.Drawing.Point”转换为“System.Drawing.Size”
      

  5.   

    ...
    for(;X<number;X++)
    {

    int pointX=System.Convert.ToInt32(ds.Tables[0].Rows[X].ItemArray[Y]);
    int pointY=System.Convert.ToInt32(ds.Tables[0].Rows[X].ItemArray[Y+1]);
    points[X]=new Point(pointX,pointY);
        
    }