Exemple #1
0
 private void MenuItemSCRPen_Click(object sender, EventArgs e)
 {
     if (this.FormBorderStyle != FormBorderStyle.None)
     {
         _zoomRatio = 1;
         flowLayoutPanel1.Visible = false;
         menuStrip1.Visible       = false;
         toolStrip1.Visible       = false;
         statusStrip1.Visible     = false;
         this.FormBorderStyle     = FormBorderStyle.None;
         MenuItemPrtScn_Click(null, null);
         toolStripSketch_Click(null, null);
         DlgDrawTool myDlgDrawTool = new DlgDrawTool();
         myDlgDrawTool._formMain = this;
         myDlgDrawTool.Show();
     }
 }
Exemple #2
0
 private void MenuItemFullSCR_Click(object sender, EventArgs e)
 {
     if (this.FormBorderStyle != FormBorderStyle.None)
     {
         _zoomRatio = 1;
         flowLayoutPanel1.Visible = false;
         menuStrip1.Visible       = false;
         toolStrip1.Visible       = false;
         statusStrip1.Visible     = false;
         this.FormBorderStyle     = FormBorderStyle.None;
         this.WindowState         = FormWindowState.Minimized;
         Thread.Sleep(200);
         int width  = Screen.PrimaryScreen.Bounds.Width;
         int height = Screen.PrimaryScreen.Bounds.Height;
         _scrSaver = true;
         _bufferBmp.Dispose();
         _bufferBmp      = new Bitmap(width, height);
         _bufferGraphics = Graphics.FromImage(_bufferBmp);
         _bufferGraphics.Clear(Color.White);
         foreach (Shape tempShape in _listShape)
         {
             tempShape.Draw(this._bufferGraphics, this._zoomRatio);
         }
         ;
         panelDraw.Width  = (int)(_bufferBmp.Width * _zoomRatio);
         panelDraw.Height = (int)(_bufferBmp.Height * _zoomRatio);
         System.Drawing.Rectangle destRect = new System.Drawing.Rectangle(0, 0, (int)(_bufferBmp.Width * _zoomRatio), (int)(_bufferBmp.Height * _zoomRatio));
         System.Drawing.Rectangle srcRect  = new System.Drawing.Rectangle(0, 0, _bufferBmp.Width, _bufferBmp.Height);
         panelDraw.CreateGraphics().DrawImage(_bufferBmp, destRect, srcRect, GraphicsUnit.Pixel);
         this.WindowState = FormWindowState.Maximized;
         toolStripSketch_Click(null, null);
         DlgDrawTool myDlgDrawTool = new DlgDrawTool();
         myDlgDrawTool._formMain = this;
         myDlgDrawTool.Show();
     }
 }