Пример #1
0
        /// <summary>
        /// Update the drawing screen
        /// </summary>
        private void handleDrawingScreen()
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new drawingScreenDelegate(handleDrawingScreen), new object[] {});
                return;
            }


            if (drawingScreen != null)
            {
                if (drawingScreen.IsVisible())
                {
                    drawingScreen.hideForm();
                }
            }

            if (drawingPanel != null)
            {
                if (drawingPanel.Visible)
                {
                    drawingPanel.hideForm();
                }
            }

            if (!this.IsVisible())
            {
                return;
            }

            if (drawingScreen == null)
            {
                Console.WriteLine("drawingScreen is null");
            }

            drawingScreen.setOwner(this);
            //drawingScreen.bringToFront();
            drawingScreen.setSize(new Size(this.Size.Width, this.Size.Height));
            drawingScreen.setLocation(new Point(cw.Location.X + 10, cw.Location.Y + 80));
            //drawingScreen.setLocation(new Point(this.Location.X+5, this.Location.Y + 50));
            //drawingScreen.setBackColor(Color.Transparent);
            drawingScreen.setBackColor(Color.Gray);
            drawingScreen.setOpacity(0.10);
            //drawingScreen.setTransparencyKey();
            drawingScreen.setFormBorderStyle(FormBorderStyle.None);
            drawingScreen.setControlBox(false);
            drawingScreen.showInTaskbar(false);
            drawingScreen.setStartPosition(FormStartPosition.Manual);
            drawingScreen.setAutoScaleMode(AutoScaleMode.None);
            drawingScreen.bringToFront();
            drawingScreen.showForm();

            //drawing panel

            drawingPanel.setOwner(this);
            //drawingScreen.bringToFront();
            drawingPanel.setSize(new Size(this.Size.Width, this.Size.Height));
            drawingPanel.setLocation(new Point(cw.Location.X + 10, cw.Location.Y + 80));
            //drawingScreen.setLocation(new Point(this.Location.X+5, this.Location.Y + 50));
            //drawingScreen.setBackColor(Color.Transparent);
            drawingPanel.setBackColor(Color.Gray);
            drawingPanel.setOpacity(1.00);
            drawingPanel.TransparencyKey = Color.Gray;
            //drawingScreen.setTransparencyKey();
            drawingPanel.setFormBorderStyle(FormBorderStyle.None);
            drawingPanel.setControlBox(false);
            drawingPanel.showInTaskbar(false);
            drawingPanel.setStartPosition(FormStartPosition.Manual);
            drawingPanel.setAutoScaleMode(AutoScaleMode.None);
            drawingPanel.bringToFront();
            drawingPanel.showForm();
            drawingPanel.Invalidate();


            //drawingPanel.MoveMouse(new Point(300, 100));


            //System.Console.WriteLine(this.Size.ToString());
        }
Пример #2
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     drawingScreen.Invalidate();
     this.Invalidate();
 }