日期:2014-05-18 浏览次数:21032 次
private void pictureBox_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Color color = new Color(); color = Color.FromArgb(128, Color.FromArgb(0, 255, 0));//设置透明度 绿 默认 SolidBrush brush = new SolidBrush(color); Queue<Point> array = new Queue<Point>(); string[] list = points.Split('|'); //坐标数据 if (list.Length >= 3) { for (int j = 0; j < list.Length; j++) { int x = Convert.ToInt32(list[j].Split(',')[0]); int y = Convert.ToInt32(list[j].Split(',')[1]); array.Enqueue(new Point(x, y)); } } g.FillPolygon(brush, array.ToArray()); brush.Dispose(); }