private void pictureBox1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; foreach (UserRect rect in userRects) { if (rect != ActiveRect) { rect.Draw(g, false); } } ActiveRect?.Draw(g, true); }
private void mPictureBox_MouseDown(object sender, MouseEventArgs e) { UserRect newActiveRect = null; foreach (UserRect rect in userRects) { if (rect.isUnder(e.Location)) { newActiveRect = rect; } } if (newActiveRect != ActiveRect) { ActiveRect = newActiveRect; } ActiveRect?.mPictureBox_MouseDown(sender, e); }
private void mPictureBox_MouseUp(object sender, MouseEventArgs e) { ActiveRect?.mPictureBox_MouseUp(sender, e); }