110,578
社区成员
发帖
与我相关
我的任务
分享
Point mypoint = new Point();
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
mypoint.X = e.X;
mypoint.Y = e.Y;
pictureBox1.Invalidate();
}
}
this._picBox.Refrush(); //好像是这个函数,不记得了
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
SolidBrush sb = new SolidBrush(Color.Black);
Pen mypen = new Pen(sb, 2f);
g.DrawEllipse(mypen, mypoint.X - 1, mypoint.Y - 1, 20, 20);
mypen.Dispose();
sb.Dispose();
}