1个回答
展开全部
1)在Form1上布一个PictureBox控件pictureBox
2)Form1后台代码如下:
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
pictureBox1.Paint += PictureBox1_Paint;
}
private void PictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
PointF[] points =
{
new PointF(197, 50),
new PointF(205, 5.9f),
new PointF(220, 8)
};
g.DrawPolygon(Pens.Blue, points);
}
}
}
----
提问中给出的各点坐标太大,上面的代码将各点坐标值缩小了100倍。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询