private void SettingChanged(object sender, EventArgs e) { setting.OnSelectedBorderChanged(); // 画面更新 PictureBox_Viewer.Refresh(); }
private void PictureBox_Viewer_MouseMove(object sender, MouseEventArgs e) { if (!readWait) { if (e.Button == MouseButtons.Left) { if (setting.Select_X < e.X && setting.Select_X + setting.Select_Width > e.X && setting.Select_Y < e.Y && setting.Select_Y + setting.Select_Height > e.Y) { setting.Select_X += e.X - setting.Select_X - r_x; setting.Select_Y += e.Y - setting.Select_Y - r_y; } else { x = e.X; y = e.Y; setting.Select_X = m_dx; setting.Select_Y = m_dy; setting.Select_Width = x - m_dx; setting.Select_Height = y - m_dy; } // 座標反転 AxisNormalization(); } else { if (setting.Select_X < e.X && setting.Select_X + setting.Select_Width > e.X && setting.Select_Y < e.Y && setting.Select_Y + setting.Select_Height > e.Y) { PictureBox_Viewer.Cursor = Cursors.SizeAll; } else { PictureBox_Viewer.Cursor = Cursors.Default; } } } // 画面更新 PictureBox_Viewer.Refresh(); }
private void RubberBand_MouseMove(object sender, MouseEventArgs e) { var rubberBand = (Panel)sender; if (e.Button == MouseButtons.Left) { var b_x = rubberBand.Left; var b_y = rubberBand.Top; if (rubberBand.Name == "RubberBand_0") { rubberBand.Left += e.X - 4; rubberBand.Top += e.Y - 4; setting.Select_X = rubberBand.Left + 4; setting.Select_Y = rubberBand.Top + 4; setting.Select_Width += b_x - rubberBand.Left; setting.Select_Height += b_y - rubberBand.Top; } else if (rubberBand.Name == "RubberBand_1") { rubberBand.Top += e.Y - 4; setting.Select_Y = rubberBand.Top + 4; setting.Select_Height += b_y - rubberBand.Top; } else if (rubberBand.Name == "RubberBand_2") { rubberBand.Left += e.X - 4; rubberBand.Top += e.Y - 4; setting.Select_Y = rubberBand.Top + 4; setting.Select_Width += e.X - 4; setting.Select_Height += b_y - rubberBand.Top; } else if (rubberBand.Name == "RubberBand_3") { rubberBand.Left += e.X - 4; setting.Select_X = rubberBand.Left + 4; setting.Select_Width += b_x - rubberBand.Left; } else if (rubberBand.Name == "RubberBand_4") { rubberBand.Left += e.X - 4; setting.Select_Width += e.X - 4; } else if (rubberBand.Name == "RubberBand_5") { rubberBand.Left += e.X - 4; rubberBand.Top += e.Y - 4; setting.Select_X = rubberBand.Left + 4; setting.Select_Width += b_x - rubberBand.Left; setting.Select_Height += e.Y - 4; } else if (rubberBand.Name == "RubberBand_6") { rubberBand.Top += e.Y - 4; setting.Select_Height += e.Y - 4; } else if (rubberBand.Name == "RubberBand_7") { rubberBand.Left += e.X - 4; rubberBand.Top += e.Y - 4; setting.Select_Width += e.X - 4; setting.Select_Height += e.Y - 4; } // 座標反転 AxisNormalization(); setting.OnSelectedBorderChanged(); } // 画面更新 PictureBox_Viewer.Refresh(); }