public ResizeManager(Crop2 crop, AreaManager region) { this.crop = crop; this.region = region; crop.KeyDown += new KeyEventHandler(crop_KeyDown); for (int i = 0; i < resizers.Length; i++) { resizers[i] = new Label(); resizers[i].Tag = i; resizers[i].Width = resizers[i].Height = 10; resizers[i].BackColor = Color.White; resizers[i].BorderStyle = BorderStyle.FixedSingle; resizers[i].MouseDown += new MouseEventHandler(ResizeManager_MouseDown); resizers[i].MouseUp += new MouseEventHandler(ResizeManager_MouseUp); resizers[i].MouseMove += new MouseEventHandler(ResizeManager_MouseMove); resizers[i].Visible = false; crop.Controls.Add(resizers[i]); } resizers[0].Cursor = Cursors.SizeNWSE; resizers[1].Cursor = Cursors.SizeNS; resizers[2].Cursor = Cursors.SizeNESW; resizers[3].Cursor = Cursors.SizeWE; resizers[4].Cursor = Cursors.SizeNWSE; resizers[5].Cursor = Cursors.SizeNS; resizers[6].Cursor = Cursors.SizeNESW; resizers[7].Cursor = Cursors.SizeWE; }
public Crop2(Image screenshot) { InitializeComponent(); Screenshot = screenshot; Manager = new AreaManager(this); Timer drawTimer = new Timer(); drawTimer.Interval = 10; drawTimer.Tick += new EventHandler(drawTimer_Tick); drawTimer.Start(); }