1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| private void saveBtn_Click(object sender, EventArgs e)
{
if (picture1.Image != null)
{
rect = new Rectangle(540, 325, 235, 210);
Graphics g = this.CreateGraphics();
g.DrawRectangle(pen, rect);
this.Invalidate();
Save(picture1);
}
}
private void picture1_MouseDown(object sender, MouseEventArgs e)
{
if (picture1.Image != null)
{
// MessageBox.Show("mouse down");
rect = new Rectangle(545, 325, 235, 210);
Graphics g = this.CreateGraphics();
g.DrawRectangle(pen, rect);
//this.Invalidate();
// painting = true;
this.Invalidate();
}
} |
Partager