Ejemplo n.º 1
0
        public void Initialize(ICalloutGraphic graphic)
        {
            TextArea = new TextAreaAnnotation
            {
                Text        = graphic.Text,
                Location    = graphic.TextLocation,
                TopLeft     = graphic.TextBoundingBox.Location,
                BottomRight = graphic.TextBoundingBox.Location +
                              new SizeF(graphic.TextBoundingBox.Width, graphic.TextBoundingBox.Height)
            };

            AnchorPoint = graphic.AnchorPoint;
        }
Ejemplo n.º 2
0
        public static Annotation CreateFrom(IControlGraphic graphic)
        {
            if (EllipseAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new EllipseAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (RectangleAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new RectangleAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (RulerAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new RulerAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (PolygonAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new PolygonAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (ProtractorAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new ProtractorAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (CalloutAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new CalloutAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (TextAreaAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new TextAreaAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }

            return(null);
        }