/// <summary> /// gets the points that make up the path with any transforms present applied. The points can be used to approximate the path by /// drawing lines between them. /// /// Important notes: ISvgPathBuilder is a faux interface that is required because PCLs cannot access System.Drawing which is used /// to get the drawing points. In order to use this method you need to put the SvgPathBuilder in your main project and then pass in /// an SvgPathBuilder object to this method. /// </summary> /// <returns>The transformed drawing points.</returns> /// <param name="pathBuilder">Path builder.</param> /// <param name="flatness">Flatness.</param> public Vector2[] getTransformedDrawingPoints( ISvgPathBuilder pathBuilder, float flatness = 3 ) { var pts = pathBuilder.getDrawingPoints( segments, flatness ); var mat = getCombinedMatrix(); Vector2Ext.transform( pts, ref mat, pts ); return pts; }
/// <summary> /// gets the points that make up the path with any transforms present applied. The points can be used to approximate the path by /// drawing lines between them. /// /// Important notes: ISvgPathBuilder is a faux interface that is required because PCLs cannot access System.Drawing which is used /// to get the drawing points. In order to use this method you need to put the SvgPathBuilder in your main project and then pass in /// an SvgPathBuilder object to this method. /// </summary> /// <returns>The transformed drawing points.</returns> /// <param name="pathBuilder">Path builder.</param> /// <param name="flatness">Flatness.</param> public Vector2[] getTransformedDrawingPoints(ISvgPathBuilder pathBuilder, float flatness = 3) { var pts = pathBuilder.getDrawingPoints(segments, flatness); var mat = getCombinedMatrix(); Vector2Ext.transform(pts, ref mat, pts); return(pts); }
/// <summary> /// beware! If pathBuilder is null the SvgReflectionPathBuilder will be used and it is slow as dirt. /// </summary> /// <param name="pathToSvgFile">Path to svg file.</param> /// <param name="pathBuilder">Path builder.</param> public SvgDebugComponent(string pathToSvgFile, ISvgPathBuilder pathBuilder = null) { svgDoc = SvgDocument.open(TitleContainer.OpenStream("Content/" + pathToSvgFile)); _pathBuilder = pathBuilder; if (_pathBuilder == null) { _pathBuilder = new SvgReflectionPathBuilder(); } }
/// <summary> /// beware! If pathBuilder is null the SvgReflectionPathBuilder will be used and it is slow as dirt. /// </summary> /// <param name="pathToSvgFile">Path to svg file relative to the Content folder</param> /// <param name="pathBuilder">Path builder.</param> public SvgDebugComponent(string pathToSvgFile, ISvgPathBuilder pathBuilder = null) { SvgDoc = SvgDocument.Open(TitleContainer.OpenStream("Content/" + pathToSvgFile)); _pathBuilder = pathBuilder; _bounds = new RectangleF(0, 0, SvgDoc.Width, SvgDoc.Height); if (_pathBuilder == null) { _pathBuilder = new SvgReflectionPathBuilder(); } }
public ResourceBuilder(IImageProvider imageProvider, ISvgPathBuilder svgBuilder) { _imageProvider = imageProvider; _svgBuilder = svgBuilder; }