public RegionCaptureSimpleAnnotateForm(Screenshot screenshot, RectangleAnnotateOptions options)
        {
            Options = options;

            backgroundImage           = screenshot.CaptureFullscreen();
            borderDotPen              = new Pen(Color.Black, 1);
            borderDotPen2             = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            textBackgroundBrush       = new SolidBrush(Color.FromArgb(75, Color.Black));
            textBackgroundPenWhite    = new Pen(Color.FromArgb(50, Color.White));
            textBackgroundPenBlack    = new Pen(Color.FromArgb(150, Color.Black));
            infoFont        = new Font("Verdana", 9);
            penTimer        = Stopwatch.StartNew();
            ScreenRectangle = CaptureHelpers.GetScreenBounds();

            InitializeComponent();
            Icon   = ShareXResources.Icon;
            Cursor = Helpers.CreateCursor(Resources.Crosshair);

            timer = new Timer {
                Interval = 10
            };
            timer.Tick += timer_Tick;
            timer.Start();
        }
Beispiel #2
0
        // Must be called before show form
        public virtual void Prepare(Screenshot screenshot)
        {
            backgroundImage = screenshot.CaptureFullscreen();

            if (Config.UseDimming)
            {
                using (Bitmap darkBackground = (Bitmap)backgroundImage.Clone())
                    using (Graphics g = Graphics.FromImage(darkBackground))
                    {
                        using (Brush brush = new SolidBrush(Color.FromArgb(30, Color.Black)))
                        {
                            g.FillRectangle(brush, 0, 0, darkBackground.Width, darkBackground.Height);
                        }

                        darkBackgroundBrush = new TextureBrush(darkBackground)
                        {
                            WrapMode = WrapMode.Clamp
                        };
                        lightBackgroundBrush = new TextureBrush(backgroundImage)
                        {
                            WrapMode = WrapMode.Clamp
                        };
                    }
            }
            else
            {
                darkBackgroundBrush = new TextureBrush(backgroundImage)
                {
                    WrapMode = WrapMode.Clamp
                };
            }
        }
        public RectangleAnnotate(RectangleAnnotateOptions options)
        {
            Options = options;

            backgroundImage           = Screenshot.CaptureFullscreen();
            borderDotPen              = new Pen(Color.Black, 1);
            borderDotPen2             = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            textBackgroundBrush       = new SolidBrush(Color.FromArgb(75, Color.Black));
            textBackgroundPenWhite    = new Pen(Color.FromArgb(50, Color.White));
            textBackgroundPenBlack    = new Pen(Color.FromArgb(150, Color.Black));
            infoFont        = new Font("Verdana", 9);
            penTimer        = Stopwatch.StartNew();
            ScreenRectangle = CaptureHelpers.GetScreenBounds();

            InitializeComponent();

            using (MemoryStream cursorStream = new MemoryStream(Resources.Crosshair))
            {
                Cursor = new Cursor(cursorStream);
            }

            timer = new Timer {
                Interval = 10
            };
            timer.Tick += timer_Tick;
            timer.Start();
        }
Beispiel #4
0
        /// <summary>Must be called before show form</summary>
        public virtual void Prepare()
        {
            if (SurfaceImage == null)
            {
                SurfaceImage = Screenshot.CaptureFullscreen();
            }

            if (Config.UseDimming)
            {
                using (Image darkSurfaceImage = ColorMatrixManager.Contrast(0.9f).Apply(SurfaceImage))
                {
                    darkBackgroundBrush = new TextureBrush(darkSurfaceImage)
                    {
                        WrapMode = WrapMode.Clamp
                    };
                }

                using (Image lightSurfaceImage = ColorMatrixManager.Contrast(1.1f).Apply(SurfaceImage))
                {
                    lightBackgroundBrush = new TextureBrush(lightSurfaceImage)
                    {
                        WrapMode = WrapMode.Clamp
                    };
                }
            }
            else
            {
                darkBackgroundBrush = new TextureBrush(SurfaceImage);
            }
        }
Beispiel #5
0
        public RectangleAnnotate(RectangleAnnotateOptions options)
        {
            Options = options;

            backgroundImage           = Screenshot.CaptureFullscreen();
            borderDotPen              = new Pen(Color.Black, 1);
            borderDotPen2             = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            rectangleInfofont         = new Font("Arial", 17, FontStyle.Bold);
            tipFont         = new Font("Arial", 13);
            penTimer        = Stopwatch.StartNew();
            ScreenRectangle = CaptureHelpers.GetScreenBounds();

            InitializeComponent();

            using (MemoryStream cursorStream = new MemoryStream(Resources.Crosshair))
            {
                Cursor = new Cursor(cursorStream);
            }

            timer = new Timer {
                Interval = 10
            };
            timer.Tick += timer_Tick;
            timer.Start();
        }
Beispiel #6
0
        /// <summary>Must be called before show form</summary>
        public virtual void Prepare()
        {
            if (SurfaceImage == null)
            {
                SurfaceImage = Screenshot.CaptureFullscreen();
            }

            if (Config.UseDimming)
            {
                /*
                 * using (Image darkSurfaceImage = ColorMatrixManager.Contrast(0.9f).Apply(SurfaceImage))
                 * {
                 *  darkBackgroundBrush = new TextureBrush(darkSurfaceImage) { WrapMode = WrapMode.Clamp };
                 * }
                 *
                 * using (Image lightSurfaceImage = ColorMatrixManager.Contrast(1.1f).Apply(SurfaceImage))
                 * {
                 *  lightBackgroundBrush = new TextureBrush(lightSurfaceImage) { WrapMode = WrapMode.Clamp };
                 * }
                 */

                using (Bitmap darkBackground = (Bitmap)SurfaceImage.Clone())
                    using (Graphics g = Graphics.FromImage(darkBackground))
                    {
                        using (Brush brush = new SolidBrush(Color.FromArgb(50, Color.Black)))
                        {
                            g.FillRectangle(brush, 0, 0, darkBackground.Width, darkBackground.Height);
                        }

                        darkBackgroundBrush = new TextureBrush(darkBackground)
                        {
                            WrapMode = WrapMode.Clamp
                        };
                        lightBackgroundBrush = new TextureBrush(SurfaceImage)
                        {
                            WrapMode = WrapMode.Clamp
                        };
                    }
            }
            else
            {
                darkBackgroundBrush = new TextureBrush(SurfaceImage)
                {
                    WrapMode = WrapMode.Clamp
                };
            }
        }
        public RectangleRegionLightForm(Screenshot screenshot)
        {
            backgroundImage = screenshot.CaptureFullscreen();
            backgroundBrush = new TextureBrush(backgroundImage);
            borderDotPen = new Pen(Color.Black, 1);
            borderDotPen2 = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            penTimer = Stopwatch.StartNew();
            ScreenRectangle = CaptureHelpers.GetScreenBounds();

            InitializeComponent();
            Icon = ShareXResources.Icon;
            Cursor = Helpers.CreateCursor(Resources.Crosshair);

            timer = new Timer { Interval = 10 };
            timer.Tick += timer_Tick;
            timer.Start();
        }
Beispiel #8
0
        public RegionCaptureLightForm(Screenshot screenshot)
        {
            backgroundImage           = screenshot.CaptureFullscreen();
            backgroundBrush           = new TextureBrush(backgroundImage);
            borderDotPen              = new Pen(Color.Black, 1);
            borderDotPen2             = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            penTimer        = Stopwatch.StartNew();
            ScreenRectangle = CaptureHelpers.GetScreenBounds();

            InitializeComponent();
            Icon   = ShareXResources.Icon;
            Cursor = Helpers.CreateCursor(Resources.Crosshair);

            timer = new Timer {
                Interval = 10
            };
            timer.Tick += timer_Tick;
            timer.Start();
        }
        public RegionCaptureSimpleAnnotateForm(Screenshot screenshot, RectangleAnnotateOptions options)
        {
            Options = options;

            backgroundImage = screenshot.CaptureFullscreen();
            borderDotPen = new Pen(Color.Black, 1);
            borderDotPen2 = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            textBackgroundBrush = new SolidBrush(Color.FromArgb(75, Color.Black));
            textBackgroundPenWhite = new Pen(Color.FromArgb(50, Color.White));
            textBackgroundPenBlack = new Pen(Color.FromArgb(150, Color.Black));
            infoFont = new Font("Verdana", 9);
            penTimer = Stopwatch.StartNew();
            ScreenRectangle = CaptureHelpers.GetScreenBounds();

            InitializeComponent();
            Icon = ShareXResources.Icon;
            Cursor = Helpers.CreateCursor(Resources.Crosshair);

            timer = new Timer { Interval = 10 };
            timer.Tick += timer_Tick;
            timer.Start();
        }
Beispiel #10
0
        public RectangleLight()
        {
            backgroundImage           = Screenshot.CaptureFullscreen();
            backgroundBrush           = new TextureBrush(backgroundImage);
            borderDotPen              = new Pen(Color.Black, 1);
            borderDotPen2             = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            penTimer        = Stopwatch.StartNew();
            ScreenRectangle = CaptureHelpers.GetScreenBounds();

            InitializeComponent();

            using (MemoryStream cursorStream = new MemoryStream(Resources.Crosshair))
            {
                Cursor = new Cursor(cursorStream);
            }

            timer = new Timer {
                Interval = 10
            };
            timer.Tick += timer_Tick;
            timer.Start();
        }
Beispiel #11
0
        /// <summary>Must be called before show form</summary>
        public virtual void Prepare(Screenshot screenshot)
        {
            backgroundImage = screenshot.CaptureFullscreen();

            if (Config.UseDimming)
            {
                using (Bitmap darkBackground = (Bitmap)backgroundImage.Clone())
                using (Graphics g = Graphics.FromImage(darkBackground))
                {
                    using (Brush brush = new SolidBrush(Color.FromArgb(30, Color.Black)))
                    {
                        g.FillRectangle(brush, 0, 0, darkBackground.Width, darkBackground.Height);
                    }

                    darkBackgroundBrush = new TextureBrush(darkBackground) { WrapMode = WrapMode.Clamp };
                    lightBackgroundBrush = new TextureBrush(backgroundImage) { WrapMode = WrapMode.Clamp };
                }
            }
            else
            {
                darkBackgroundBrush = new TextureBrush(backgroundImage) { WrapMode = WrapMode.Clamp };
            }
        }