コード例 #1
0
        private void ReadGridAttributes(GridVObject vObject, SvgVoGrid svg)
        {
            ReadBaseRectangleVObjectAttributes(vObject, svg);

            vObject.ControlPoints = new[]
            {
                new PointF(svg.X, svg.Y),
                new PointF(svg.X + svg.Cols * svg.StepX, svg.Y + svg.Rows * svg.StepY)
            };

            vObject.VerticalLineColor   = svg.GetVerticalLineColor(_serializer);
            vObject.HorizontalLineColor = svg.GetHorizontalLineColor(_serializer);

            vObject.LineWidth = svg.StrokeWidth;

            vObject.Cols           = svg.Cols;
            vObject.Rows           = svg.Rows;
            vObject.StepX          = svg.StepX;
            vObject.StepY          = svg.StepY;
            vObject.FixedLineWidth = svg.FixedStrokeWidth;
        }
コード例 #2
0
        private void WriteGridAttributes(SvgVoGrid svg, GridVObject vObject)
        {
            WriteBaseRectangleVObjectAttributes(svg, vObject);

            var cm = vObject.GetColorManagement(true);

            svg.SetVerticalLineColor(vObject.VerticalLineColor, ColorManagement.GetPreviewColor(cm, vObject.VerticalLineColor), _serializer);
            svg.SetHorizontalLineColor(vObject.HorizontalLineColor, ColorManagement.GetPreviewColor(cm, vObject.HorizontalLineColor), _serializer);

            svg.StrokeWidth = vObject.LineWidth;

            svg.Cols  = vObject.Cols;
            svg.Rows  = vObject.Rows;
            svg.StepX = vObject.StepX;
            svg.StepY = vObject.StepY;

            var rect = vObject.Rectangle.ToRectangleF();

            svg.X = rect.X;
            svg.Y = rect.Y;
            svg.FixedStrokeWidth = vObject.FixedLineWidth;
        }
コード例 #3
0
 internal SvgElement ToSvg(VObject vObject)
 {
     if (vObject is GridVObject)
     {
         var svg = new SvgVoGrid();
         WriteGridAttributes(svg, vObject as GridVObject);
         return(svg);
     }
     else if (vObject is PolylineVObject)
     {
         var svg = new SvgPolyline();
         WritePolylineAttributes(svg, vObject as PolylineVObject);
         return(svg);
     }
     else if (vObject is DashedLineVObject)
     {
         var svg = new SvgVoDashLine();
         WriteDashLineAttributes(svg, vObject as DashedLineVObject);
         return(svg);
     }
     else if (vObject is LineVObject)
     {
         var svg = new SvgLine();
         WriteLineAttributes(svg, vObject as LineVObject);
         return(svg);
     }
     else if (vObject is EllipseVObject)
     {
         var svg = new SvgEllipse();
         WriteEllipseAttributes(svg, vObject as EllipseVObject);
         return(svg);
     }
     else if (vObject is SvgVObject)
     {
         var svg = new SvgVoSvg();
         WriteSvgAttributes(svg, vObject as SvgVObject);
         return(svg);
     }
     else if (vObject is ImageVObject)
     {
         var svg = new SvgVoImage();
         WriteImageAttributes(svg, vObject as ImageVObject);
         return(svg);
     }
     else if (vObject is PlainTextVObject)
     {
         var svg = new SvgVoPlainText();
         WritePlainTextAttributes(svg, vObject as PlainTextVObject);
         return(svg);
     }
     else if (vObject is CurvedTextVObject)
     {
         var svg = new SvgVoCurvedText();
         WriteCurvedTextAttributes(svg, vObject as CurvedTextVObject);
         return(svg);
     }
     else if (vObject is PathBoundedTextVObject)
     {
         var svg = new SvgVoPathBoundedText();
         WritePathBoundedTextAttributes(svg, vObject as PathBoundedTextVObject);
         return(svg);
     }
     else if (vObject is BoundedTextVObject)
     {
         var svg = new SvgVoBoundedText();
         WriteBoundedTextAttributes(svg, vObject as BoundedTextVObject);
         return(svg);
     }
     else if (vObject is AutoScaledTextVObject)
     {
         var svg = new SvgVoAutoScaledText();
         WriteAutoScaledTextAttributes(svg, vObject as AutoScaledTextVObject);
         return(svg);
     }
     else if (vObject is PlaceholderVObject)
     {
         var svg = new SvgVoPlaceholder();
         WritePlaceholderAttributes(svg, vObject as PlaceholderVObject);
         return(svg);
     }
     else if (vObject is RectangleVObject)
     {
         var svg = new SvgVoRectangle();
         WriteRectangleAttributes(svg, vObject as RectangleVObject);
         return(svg);
     }
     else if (vObject is ShapeVObject)
     {
         var svg = new SvgVoShape();
         WriteShapeAttributes(svg, vObject as ShapeVObject);
         return(svg);
     }
     else
     {
         return(null);
     }
 }