ose () ;; 2:=e.Location; ( g, DrawRect (startPoint, movePoint)) ;; 3:=e.Location; (g, DrawRect (startPoint, movePoint)) ;; 5:=false ;; 7:
//textBox1.Font=font; (isMouseDown)
{= e.Location; (startPoint!=movePoint)
{(movePoint.X lt; startPoint.X amp; amp; movePoint.Y lt; startPoint.Y)
{= new Point (startPoint.X, startPoint.Y);=e.Location;
}
{(movePoint.X lt; startPoint.X)
{buf=startPoint.X; .X=movePoint.X; .X=buf;
}
{(movePoint.Y lt; startPoint.Y)
{buf=startPoint.Y; .Y=movePoint.Y; .Y=buf;
}
}
} graphic=Graphics.FromImage (pictureBox1.Image);=new Selector
{= new Point (Location.X + pictureBox1.Location.X + panel1.Location.X + startPoint.X + 10, Location.Y + pictureBox1.Location.Y + 30 + panel1.Location.Y + startPoint.Y),=new Size (Math.Abs ??(startPoint.X - movePoint.X) ,. Abs (startPoint.Y - movePoint.Y)),=this
} ;. Show ();=false;
}
};
}. Dispose () ;. Invalidate () ;. Refresh ();//не дає можливості малювати за палітрою
}
}
private void pictureBox1_MouseDown (object sender, MouseEventArgs e)
{= startPoint=e.Location; ();//відміна дії=true; (selector!=null) .Close (); (Control.ModifierKeys == Keys.Alt)
{c=(pictureBox1.Image as Bitmap) .GetPixel (eX, eY); (e.Button == MouseButtons.Left) .BackColor=c; .BackColor=c;
} (mode == 4)
{g=Graphics.FromImage (pictureBox1.Image); b=new SolidBrush (pen.Color); fs=comboBox2.Text;=new Font (fs.ToString (), (float) numericUpDown2.Value,
(
(checkBox2.Checked? FontStyle.Bold: FontStyle.Regular) |
(checkBox3.Checked? FontStyle.Italic: FontStyle.Regular) |
(checkBox4.Checked? FontStyle.Underline: FontStyle.Regular)
), GraphicsUnit.Point, 204) ;. Font=font; //=fontDialog1.Font; .DrawString (textBox1.Text, font, b, e.Location) ;. Dispose ();.Invalidate ();
} (mode == 5)
{
//this.Cursor=new Cursor (GetType (), c: lastik.cur );
//this.Cursor=NativeMethods.LoadCustomCursor (@ c: aero_busy_l.ani ); g=Graphics.FromImage (pictureBox1.Image); size_of_lastic=(int) numericUpDown1.Value;.FillEllipse (new SolidBrush (Color.White), eX - size_of_lastic/2, eY - size_of_lastic/2, size_of_lastic, size_of_lastic) ;. Invalidate () ;. Dispose ();
} (mode == 6)
{
} (mode == 7)
{= true;=new Point (eX, eY);
}
} Клас Seletor
public partial class Selector: Form
{MainForm form1; Selector ()
{();
}
private void Selector_Load (object sender, EventArgs e)
{= Owner as MainForm; .Enabled=form1.buffer!=null; .копіроватьToolStripMenuItem.Enabled=true;
}
private void Selector_Activated (object sender, EventArgs e)
{= Owner as MainForm; .Focus ();
}
public void CoryToolStripMenuItem_Click (object sender, EventArgs e)
{= Owner as MainForm; buf1=form1.pictureBox1.Image as Bitmap; .buffer=buf1.Clone (new Rectangle (form1.startPoint, Size), buf1.PixelFormat) ;. вставітьToolStripMenuItem1.Enabled =true; ();
}
public void CutToolStripMenuItem_Click (object sender, EventArgs e)
{= Owner as MainForm; buf1=form1.pictureBox1.Image as Bitmap; .buffer=buf1.Clone (new Rectangle (form1.startPoint, Size), buf1.PixelFormat) ;. UpdateOldImage () ; (var graphics=Graphics.FromImage (form1.pictureBox1.Image))
{. FillRectangle (new SolidBrush (Color.White), new Rectangle (form1.startPoint, Size));
}. pictureBox1.Refresh (); ();
}
private void DeleteToolStripMenuItem_Click (object sender, EventArgs e)
{= Owner as MainForm; .UpdateOldImage (); (var graphics=Graphics.FromImage (form1.pictureBox1.Image))
{. FillRectangle (new SolidBrush (Color.White), new Rectangle (form1.startPoint, Size));
...