Beispiel #1
0
        /// <summary>
        /// Вывод на печать
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Enter_text_Form.Text = null;
            Enter_text_Form.Hide();
            Bitmap img = new Bitmap(Paint_panel.Width, Paint_panel.Height);

            Paint_panel.DrawToBitmap(img, new Rectangle(0, 0, Paint_panel.Width, Paint_panel.Height));
            Graphics g = e.Graphics;

            g.DrawImage(img, 0, 0);
        }
Beispiel #2
0
 private void Paint_panel_MouseUp(object sender, MouseEventArgs e)
 {
     if (obj != null)
     {
         obj.Finish1 = e.Location;
         buf.Add(obj);
     }
     obj             = new Line();
     flag_mouseclick = false;
     Paint_panel.Invalidate();
 }
Beispiel #3
0
 private void Paint_panel_MouseMove(object sender, MouseEventArgs e)
 {
     if (flag_mouseclick && !flag_eraser)
     {
         if (obj != null)
         {
             obj.Finish1 = e.Location;
             Paint_panel.Refresh();
         }
     }
     else if (flag_mouseclick && flag_eraser)
     {
         if (obj != null)
         {
             obj.path.Add(e.Location);
             Paint_panel.Refresh();
         }
     }
 }
Beispiel #4
0
 /// <summary>
 /// Открыть файл
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     buf.Open();
     Paint_panel.Invalidate();
 }
Beispiel #5
0
 /// <summary>
 /// Вернуть изменение
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void reDoToolStripMenuItem_Click(object sender, EventArgs e)
 {
     buf.drawStep();
     Paint_panel.Invalidate();
 }
Beispiel #6
0
 /// <summary>
 /// Откатить изменение
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void unDoToolStripMenuItem_Click(object sender, EventArgs e)
 {
     buf.unDrawStep();
     Paint_panel.Refresh();
 }