110,535
社区成员
发帖
与我相关
我的任务
分享
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();
}