public List<SvgPath> GetPathsForViewport (int width, int height) { Paths.Clear (); var canvas = new SvgCanvas (this, width, height); RectF viewBox = svg.DocumentViewBox; float scale = Math.Min (width / viewBox.Width (), height / viewBox.Height ()); canvas.Translate ( (width - viewBox.Width() * scale) / 2.0f, (height - viewBox.Height() * scale) / 2.0f); canvas.Scale (scale, scale); svg.RenderToCanvas (canvas); return Paths; }
public List <SvgPath> GetPathsForViewport(int width, int height) { paths.Clear(); var canvas = new SvgCanvas(this, width, height); RectF viewBox = svg.DocumentViewBox; float scale = Math.Min(width / viewBox.Width(), height / viewBox.Height()); canvas.Translate( (width - viewBox.Width() * scale) / 2.0f, (height - viewBox.Height() * scale) / 2.0f); canvas.Scale(scale, scale); svg.RenderToCanvas(canvas); return(paths); }