/// <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); }
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(); }
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(); } } }
/// <summary> /// Открыть файл /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void openToolStripMenuItem_Click(object sender, EventArgs e) { buf.Open(); Paint_panel.Invalidate(); }
/// <summary> /// Вернуть изменение /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void reDoToolStripMenuItem_Click(object sender, EventArgs e) { buf.drawStep(); Paint_panel.Invalidate(); }
/// <summary> /// Откатить изменение /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void unDoToolStripMenuItem_Click(object sender, EventArgs e) { buf.unDrawStep(); Paint_panel.Refresh(); }