Convert SVG to drawable/canvas for GraphicsView in .NET MAUI app

256 Views Asked by At

Is there a way to convert SVG vector files, or any vector illustration format, into actual drawables for a GraphicsView in my .NET MAUI application?

This is an example of the code I'd like to end up with, in case of a simple rectangle. Though some of the illustrations can have multiple colors and elements:

canvas.StrokeColor = Colors.DarkBlue;
canvas.StrokeSize = 4;
canvas.DrawRectangle(10, 10, 100, 50);

I would like to input an SVG file somewhere to receive the code for a canvas object to use in my application. Main goal is getting rid of the SVG files entirely so I only have some code to deal with in my program. Perhaps changing a few colors or anchor points using the position parameters of the DrawRectangle() for example. ShapeShifter does something similar but it converts any SVG into an XML file, mainly for use in Android.

0

There are 0 best solutions below