Пример #1
0
        public static PointInfo GetPointInfo()
        {
            using (RectangleRegionForm form = new RectangleRegionForm(RectangleRegionMode.ScreenColorPicker))
            {
                form.Config.DetectWindows = false;
                form.Config.ShowTips      = false;
                form.Config.UseDimming    = false;

                form.Prepare();
                form.ShowDialog();

                if (form.Result == RegionResult.Region)
                {
                    PointInfo pointInfo = new PointInfo();
                    pointInfo.Position = form.CurrentPosition;
                    pointInfo.Color    = form.CurrentColor;
                    return(pointInfo);
                }
            }

            return(null);
        }
Пример #2
0
        public static PointInfo GetPointInfo(RegionCaptureOptions options, Bitmap canvas = null)
        {
            RegionCaptureOptions newOptions = GetRegionCaptureOptions(options);

            newOptions.DetectWindows = false;
            newOptions.UseDimming    = false;

            using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.ScreenColorPicker, newOptions, canvas))
            {
                form.ShowDialog();

                if (form.Result == RegionResult.Region)
                {
                    PointInfo pointInfo = new PointInfo();
                    pointInfo.Position = form.CurrentPosition;
                    pointInfo.Color    = form.ShapeManager.GetCurrentColor();
                    return(pointInfo);
                }
            }

            return(null);
        }
Пример #3
0
        public static PointInfo GetPointInfo()
        {
            using (RectangleRegionForm form = new RectangleRegionForm(RectangleRegionMode.ScreenColorPicker))
            {
                form.Config.DetectWindows = false;
                form.Config.ShowTips = false;
                form.Config.UseDimming = false;

                form.Prepare();
                form.ShowDialog();

                if (form.Result == RegionResult.Region)
                {
                    PointInfo pointInfo = new PointInfo();
                    pointInfo.Position = form.CurrentPosition;
                    pointInfo.Color = form.CurrentColor;
                    return pointInfo;
                }
            }

            return null;
        }
Пример #4
0
        public static PointInfo GetPointInfo(RegionCaptureOptions options)
        {
            using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.ScreenColorPicker))
            {
                form.Config = GetRegionCaptureOptions(options);
                form.Config.DetectWindows = false;
                form.Config.ShowHotkeys   = false;
                form.Config.UseDimming    = false;

                form.Prepare();
                form.ShowDialog();

                if (form.Result == RegionResult.Region)
                {
                    PointInfo pointInfo = new PointInfo();
                    pointInfo.Position = form.CurrentPosition;
                    pointInfo.Color    = form.CurrentColor;
                    return(pointInfo);
                }
            }

            return(null);
        }
Пример #5
0
        public static PointInfo GetPointInfo(RegionCaptureOptions options)
        {
            using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.ScreenColorPicker))
            {
                form.Config = GetRegionCaptureOptions(options);
                form.Config.DetectWindows = false;
                form.Config.ShowHotkeys = false;
                form.Config.UseDimming = false;

                form.Prepare();
                form.ShowDialog();

                if (form.Result == RegionResult.Region)
                {
                    PointInfo pointInfo = new PointInfo();
                    pointInfo.Position = form.CurrentPosition;
                    pointInfo.Color = form.CurrentColor;
                    return pointInfo;
                }
            }

            return null;
        }