Ejemplo n.º 1
0
        private void CheckHover()
        {
            CurrentHoverShape = null;

            if (!IsCursorOnNode && !IsCreating && !IsMoving && !IsResizing)
            {
                BaseShape shape = GetIntersectShape();

                if (shape != null && shape.IsValidShape)
                {
                    CurrentHoverShape = shape;
                }
                else
                {
                    switch (CurrentShapeType)
                    {
                    case ShapeType.RegionFreehand:
                    case ShapeType.DrawingFreehand:
                    case ShapeType.DrawingLine:
                    case ShapeType.DrawingArrow:
                    case ShapeType.DrawingTextOutline:
                    case ShapeType.DrawingTextBackground:
                    case ShapeType.DrawingSpeechBalloon:
                    case ShapeType.DrawingStep:
                    case ShapeType.DrawingImage:
                        return;
                    }

                    if (Config.IsFixedSize && IsCurrentShapeTypeRegion)
                    {
                        Point location = InputManager.MousePosition0Based;

                        CurrentHoverShape = new RectangleRegionShape()
                        {
                            Rectangle = new Rectangle(new Point(location.X - Config.FixedSize.Width / 2, location.Y - Config.FixedSize.Height / 2), Config.FixedSize)
                        };
                    }
                    else
                    {
                        SimpleWindowInfo window = FindSelectedWindow();

                        if (window != null && !window.Rectangle.IsEmpty)
                        {
                            Rectangle hoverArea = CaptureHelpers.ScreenToClient(window.Rectangle);

                            CurrentHoverShape = new RectangleRegionShape()
                            {
                                Rectangle = Rectangle.Intersect(form.ScreenRectangle0Based, hoverArea)
                            };
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private BaseShape CreateShape(ShapeType shapeType)
        {
            BaseShape shape;

            switch (shapeType)
            {
            default:
            case ShapeType.RegionRectangle:
                shape = new RectangleRegionShape();
                break;

            case ShapeType.RegionEllipse:
                shape = new EllipseRegionShape();
                break;

            case ShapeType.RegionFreehand:
                shape = new FreehandRegionShape();
                break;

            case ShapeType.DrawingRectangle:
                shape = new RectangleDrawingShape();
                break;

            case ShapeType.DrawingEllipse:
                shape = new EllipseDrawingShape();
                break;

            case ShapeType.DrawingFreehand:
                shape = new FreehandDrawingShape();
                break;

            case ShapeType.DrawingLine:
                shape = new LineDrawingShape();
                break;

            case ShapeType.DrawingArrow:
                shape = new ArrowDrawingShape();
                break;

            case ShapeType.DrawingTextOutline:
                shape = new TextOutlineDrawingShape();
                break;

            case ShapeType.DrawingTextBackground:
                shape = new TextDrawingShape();
                break;

            case ShapeType.DrawingSpeechBalloon:
                shape = new SpeechBalloonDrawingShape();
                break;

            case ShapeType.DrawingStep:
                shape = new StepDrawingShape();
                break;

            case ShapeType.DrawingImage:
                shape = new ImageDrawingShape();
                break;

            case ShapeType.DrawingImageScreen:
                shape = new ImageScreenDrawingShape();
                break;

            case ShapeType.DrawingCursor:
                shape = new CursorDrawingShape();
                break;

            case ShapeType.EffectBlur:
                shape = new BlurEffectShape();
                break;

            case ShapeType.EffectPixelate:
                shape = new PixelateEffectShape();
                break;

            case ShapeType.EffectHighlight:
                shape = new HighlightEffectShape();
                break;

            case ShapeType.DrawingCrop:
                shape = new CropDrawingShape();
                break;
            }

            shape.Manager = this;

            shape.OnConfigLoad();

            return(shape);
        }
Ejemplo n.º 3
0
        public BaseShape CreateShape()
        {
            BaseShape shape;

            switch (CurrentShapeType)
            {
                default:
                case ShapeType.RegionRectangle:
                    shape = new RectangleRegionShape();
                    break;
                case ShapeType.RegionRoundedRectangle:
                    shape = new RoundedRectangleRegionShape();
                    break;
                case ShapeType.RegionEllipse:
                    shape = new EllipseRegionShape();
                    break;
                case ShapeType.DrawingRectangle:
                    shape = new RectangleDrawingShape();
                    break;
                case ShapeType.DrawingRoundedRectangle:
                    shape = new RoundedRectangleDrawingShape();
                    break;
                case ShapeType.DrawingEllipse:
                    shape = new EllipseDrawingShape();
                    break;
                case ShapeType.DrawingLine:
                    shape = new LineDrawingShape();
                    break;
                case ShapeType.DrawingArrow:
                    shape = new ArrowDrawingShape();
                    break;
                case ShapeType.DrawingText:
                    shape = new TextDrawingShape();
                    break;
                case ShapeType.DrawingStep:
                    shape = new StepDrawingShape();
                    break;
                case ShapeType.DrawingBlur:
                    shape = new BlurEffectShape();
                    break;
                case ShapeType.DrawingPixelate:
                    shape = new PixelateEffectShape();
                    break;
                case ShapeType.DrawingHighlight:
                    shape = new HighlightEffectShape();
                    break;
            }

            shape.Manager = this;

            shape.UpdateShapeConfig();

            return shape;
        }
Ejemplo n.º 4
0
        private void CheckHover()
        {
            CurrentHoverShape = null;

            if (!IsCursorOnNode && !IsCreating && !IsMoving && !IsResizing)
            {
                BaseShape shape = GetIntersectShape();

                if (shape != null && shape.IsValidShape)
                {
                    CurrentHoverShape = shape;
                }
                else
                {
                    switch (CurrentShapeType)
                    {
                        case ShapeType.RegionFreehand:
                        case ShapeType.DrawingFreehand:
                        case ShapeType.DrawingLine:
                        case ShapeType.DrawingArrow:
                        case ShapeType.DrawingText:
                        case ShapeType.DrawingSpeechBalloon:
                        case ShapeType.DrawingStep:
                        case ShapeType.DrawingImage:
                            return;
                    }

                    if (Config.IsFixedSize && IsCurrentShapeTypeRegion)
                    {
                        Point location = InputManager.MousePosition0Based;

                        CurrentHoverShape = new RectangleRegionShape()
                        {
                            Rectangle = new Rectangle(new Point(location.X - Config.FixedSize.Width / 2, location.Y - Config.FixedSize.Height / 2), Config.FixedSize)
                        };
                    }
                    else
                    {
                        SimpleWindowInfo window = FindSelectedWindow();

                        if (window != null && !window.Rectangle.IsEmpty)
                        {
                            Rectangle hoverArea = CaptureHelpers.ScreenToClient(window.Rectangle);

                            CurrentHoverShape = new RectangleRegionShape()
                            {
                                Rectangle = Rectangle.Intersect(form.ScreenRectangle0Based, hoverArea)
                            };
                        }
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private BaseShape CreateShape(ShapeType shapeType)
        {
            BaseShape shape;

            switch (shapeType)
            {
                default:
                case ShapeType.RegionRectangle:
                    shape = new RectangleRegionShape();
                    break;
                case ShapeType.RegionRoundedRectangle:
                    shape = new RoundedRectangleRegionShape();
                    break;
                case ShapeType.RegionEllipse:
                    shape = new EllipseRegionShape();
                    break;
                case ShapeType.RegionFreehand:
                    shape = new FreehandRegionShape();
                    break;
                case ShapeType.DrawingRectangle:
                    shape = new RectangleDrawingShape();
                    break;
                case ShapeType.DrawingRoundedRectangle:
                    shape = new RoundedRectangleDrawingShape();
                    break;
                case ShapeType.DrawingEllipse:
                    shape = new EllipseDrawingShape();
                    break;
                case ShapeType.DrawingFreehand:
                    shape = new FreehandDrawingShape();
                    break;
                case ShapeType.DrawingLine:
                    shape = new LineDrawingShape();
                    break;
                case ShapeType.DrawingArrow:
                    shape = new ArrowDrawingShape();
                    break;
                case ShapeType.DrawingText:
                    shape = new TextDrawingShape();
                    break;
                case ShapeType.DrawingSpeechBalloon:
                    shape = new SpeechBalloonDrawingShape();
                    break;
                case ShapeType.DrawingStep:
                    shape = new StepDrawingShape();
                    break;
                case ShapeType.DrawingImage:
                    shape = new ImageDrawingShape();
                    break;
                case ShapeType.EffectBlur:
                    shape = new BlurEffectShape();
                    break;
                case ShapeType.EffectPixelate:
                    shape = new PixelateEffectShape();
                    break;
                case ShapeType.EffectHighlight:
                    shape = new HighlightEffectShape();
                    break;
            }

            shape.Manager = this;

            shape.OnConfigLoad();

            return shape;
        }
Ejemplo n.º 6
0
        public BaseShape CreateShape()
        {
            BaseShape shape;

            switch (CurrentShapeType)
            {
            default:
            case ShapeType.RegionRectangle:
                shape = new RectangleRegionShape();
                break;

            case ShapeType.RegionRoundedRectangle:
                shape = new RoundedRectangleRegionShape();
                break;

            case ShapeType.RegionEllipse:
                shape = new EllipseRegionShape();
                break;

            case ShapeType.DrawingRectangle:
                shape = new RectangleDrawingShape();
                break;

            case ShapeType.DrawingRoundedRectangle:
                shape = new RoundedRectangleDrawingShape();
                break;

            case ShapeType.DrawingEllipse:
                shape = new EllipseDrawingShape();
                break;

            case ShapeType.DrawingLine:
                shape = new LineDrawingShape();
                break;

            case ShapeType.DrawingArrow:
                shape = new ArrowDrawingShape();
                break;

            case ShapeType.DrawingText:
                shape = new TextDrawingShape();
                break;

            case ShapeType.DrawingStep:
                shape = new StepDrawingShape();
                break;

            case ShapeType.DrawingBlur:
                shape = new BlurEffectShape();
                break;

            case ShapeType.DrawingPixelate:
                shape = new PixelateEffectShape();
                break;

            case ShapeType.DrawingHighlight:
                shape = new HighlightEffectShape();
                break;
            }

            shape.Manager = this;

            shape.UpdateShapeConfig();

            return(shape);
        }