Exemplo n.º 1
0
        }//Draw方法——注记点

        public static void Draw(Graphics g, int x, int y, int Width, int Height, Linkpoint lpt)
        {                                                     //绘制一个关联点
            Pen   point_pen   = new Pen(lpt.color_out, 1);    //画笔
            Brush point_brush = new SolidBrush(lpt.color_in); //画刷

            g.DrawEllipse(point_pen, x - (lpt.Size - 1) / 2, y - (lpt.Size - 1) / 2, lpt.Size, lpt.Size);
            g.FillEllipse(point_brush, x - (lpt.Size - 1) / 2, y - (lpt.Size - 1) / 2, lpt.Size, lpt.Size); //填充椭圆
        }//Draw方法——关联点
Exemplo n.º 2
0
        }//DataType方法,判断导入数据类型

        public static void Importfile(StreamReader f, Graphics g, int Height, int Width)
        {
            while (f.Peek() > -1)               //判断文件有没有读取完
            {
                string tmp = f.ReadLine();      //读取第一行信息
                switch (Funcs.DataType(tmp))    //根据数据类型绘制
                {
                case 1:                         //为实体点
                {
                    string temp = f.ReadLine(); //再读一行字符串,判断是否为空,不为空就录入
                    while (temp != null && temp != ",,,")
                    {                           //实例化实体点并加入实体点集
                        Realpoint realpoint = new Realpoint(temp);
                        MyGlo.rplist.Add(realpoint);
                        temp = f.ReadLine();
                    }    //while
                }        //case 1
                break;

                case 2:    //为注记点
                {
                    string temp = f.ReadLine();
                    while (temp != null && temp != ",,,")
                    {
                        Notepoint notepoint = new Notepoint(temp);
                        MyGlo.nplist.Add(notepoint);
                        temp = f.ReadLine();
                    }
                }        //case 2
                break;

                case 3:     //为常规线
                {
                    string           temp    = f.ReadLine();
                    List <Basepoint> bt_temp = new List <Basepoint>();
                    while (temp != null && temp != ",,,")
                    {
                        Linkpoint linkpoint = new Linkpoint(temp);
                        bt_temp.Add(linkpoint);
                        temp = f.ReadLine();
                    }
                    Lineshape lineshape = new Lineshape(bt_temp, tmp); //实例化线对象
                    MyGlo.llist.Add(lineshape);                        //加入列表
                }                                                      //case3
                break;

                case 4:     //为弧线
                {
                    string           temp    = f.ReadLine();
                    List <Basepoint> bt_temp = new List <Basepoint>();
                    while (temp != null && temp != ",,,")
                    {
                        Linkpoint linkpoint = new Linkpoint(temp);
                        bt_temp.Add(linkpoint);
                        temp = f.ReadLine();
                    }
                    Lineshape lineshape = new Lineshape(bt_temp, tmp);
                    MyGlo.llist.Add(lineshape);
                }
                break;         //case4

                case 5:
                {
                    string           temp    = f.ReadLine();
                    List <Basepoint> bt_temp = new List <Basepoint>();
                    while (temp != null && temp != ",,,")
                    {
                        Linkpoint linkpoint = new Linkpoint(temp);
                        bt_temp.Add(linkpoint);
                        temp = f.ReadLine();
                    }
                    Lineshape lineshape = new Lineshape(bt_temp, tmp);
                    MyGlo.llist.Add(lineshape);
                }
                break;        //case5

                case 6:
                {
                    string           temp    = f.ReadLine();
                    List <Basepoint> bt_temp = new List <Basepoint>();
                    while (temp != null && temp != ",,,")
                    {
                        Linkpoint linkpoint = new Linkpoint(temp);
                        bt_temp.Add(linkpoint);
                        temp = f.ReadLine();
                    }
                    Lineshape lineshape = new Lineshape(bt_temp, tmp);
                    MyGlo.llist.Add(lineshape);
                }
                break;        //case6
                }//switch   Funcs.Update(g, Width, Height);
            }//while
        } //importfile,导入roi