Beispiel #1
0
        public void SetDesktopCaptureBitmap(Bitmap originalDesktopBitmap, Rectangle desktopArea)
        {
            originalDesktopCaptureBitmap = originalDesktopBitmap;
            // Get a darker version of the bitmap to display
            darkDesktopCaptureBitmap = BitmapService.ModifyBitmap(originalDesktopCaptureBitmap, 0.9f, 0.9f, 1.0f);

            int screenLeft   = SystemInformation.VirtualScreen.Left;
            int screenTop    = SystemInformation.VirtualScreen.Top;
            int screenWidth  = SystemInformation.VirtualScreen.Width;
            int screenHeight = SystemInformation.VirtualScreen.Height;

            // Setup this form so it covers the entire desktop area, spanning all monitors
            FormBorderStyle = FormBorderStyle.None;
            WindowState     = FormWindowState.Normal;

            Size     = new Size(screenWidth, screenHeight);
            Location = new Point(screenLeft, screenTop);

            // Update the pixture box to show the darker desktop bitmap
            pictureBox.Size     = new Size(screenWidth, screenHeight);
            pictureBox.Location = new Point(0, 0);
            pictureBox.Image    = darkDesktopCaptureBitmap;
            pictureBox.Invalidate();

            Cursor = Cursors.Cross;
        }