当前位置:编程学习 > C#/ASP.NET >>

根据给定图层或坐标点,在图层中画图

已知一个图层和四个坐标点,在该图层上画矩形,请给出思路,或用到哪些接口,最好是给出代码,谢谢。 --------------------编程问答-------------------- 已知四个点或更多点的坐标值,要求在某一特定图层上画多边形。下面代码是在windows程序中实现的,想问下可以不可以在web程序中实现,谢谢哪个高手指点下。 
Point[] myArray =
             {
                 new Point(0,0),
                 
                 new Point(10,40),
                 
                 new Point(80,50),
                 new Point(60,30),
                 //new Point(100,30)
             };
            GraphicsPath myPath = new GraphicsPath();
            Graphics g = this.CreateGraphics();
            myPath.AddPolygon(myArray);
            Pen myPen = new Pen(Color.Red, 2);
            Brush muBrush = new SolidBrush(Color.Red);
            g.DrawPath(myPen, myPath);
            g.FillPath(muBrush, myPath);
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,