private void PasteFromClipboard() { if (Clipboard.ContainsImage()) { Image img = ClipboardHelpers.GetImage(); if (img != null) { CurrentShapeType = ShapeType.DrawingImage; ImageDrawingShape shape = (ImageDrawingShape)CreateShape(ShapeType.DrawingImage); shape.StartPosition = shape.EndPosition = InputManager.MousePosition0Based; shape.SetImage(img, true); AddShape(shape); SelectCurrentShape(); } } else if (Clipboard.ContainsText()) { string text = Clipboard.GetText(); if (!string.IsNullOrEmpty(text)) { CurrentShapeType = ShapeType.DrawingTextBackground; TextDrawingShape shape = (TextDrawingShape)CreateShape(ShapeType.DrawingTextBackground); shape.StartPosition = shape.EndPosition = InputManager.MousePosition0Based; shape.Text = text.Trim(); shape.AutoSize(true); AddShape(shape); SelectCurrentShape(); } } }
private void PasteFromClipboard() { if (Clipboard.ContainsImage()) { Image img = ClipboardHelpers.GetImage(); if (img != null) { CurrentTool = ShapeType.DrawingImage; ImageDrawingShape shape = (ImageDrawingShape)CreateShape(ShapeType.DrawingImage); Point pos = InputManager.ClientMousePosition; shape.Rectangle = new Rectangle(pos.X, pos.Y, 1, 1); shape.SetImage(img, true); AddShape(shape); SelectCurrentShape(); } } else if (Clipboard.ContainsText()) { string text = Clipboard.GetText(); if (!string.IsNullOrEmpty(text)) { CurrentTool = ShapeType.DrawingTextBackground; TextDrawingShape shape = (TextDrawingShape)CreateShape(ShapeType.DrawingTextBackground); Point pos = InputManager.ClientMousePosition; shape.Rectangle = new Rectangle(pos.X, pos.Y, 1, 1); shape.Text = text.Trim(); shape.AutoSize(true); AddShape(shape); SelectCurrentShape(); } } }
public override BaseShape Duplicate() { Image imageTemp = Image; Image = null; ImageDrawingShape shape = (ImageDrawingShape)base.Duplicate(); shape.Image = imageTemp.CloneSafe(); Image = imageTemp; return(shape); }
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); }
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; }