We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to load a generated svg image. Unfortunately Forms9Patch doesn't allow this; it just taskes ImageSources from local files.
So my workaround is to create a local temporary image and load from this. This works but I would like to read directly from a string.
Is there a possibility to load my SVG directly from memory?
The text was updated successfully, but these errors were encountered:
@GW-FUB -
I've just added Forms9Patch.ImageSource.FromSvgText(string svgText) to the dev branch and it is passing all of the tests. Usage example:
Forms9Patch.ImageSource.FromSvgText(string svgText)
var svgString = $@" <svg xmlns=""http://www.w3.org/2000/svg"" viewBox=""0 0 96 105""> <g fill=""#97C024"" stroke=""#97C024"" stroke-linejoin=""round"" stroke-linecap=""round""> <path d=""M14,40v24M81,40v24M38,68v24M57,68v24M28,42v31h39v-31z"" stroke-width=""12""/> <path d=""M32,5l5,10M64,5l-6,10"" stroke-width=""2""/> </g> <path d=""M22,35h51v10h-51zM22,33c0-31,51-31,51,0"" fill=""#97C024""/> <g fill=""#FFF""> <circle cx=""36"" cy=""22"" r=""2""/> <circle cx=""59"" cy=""22"" r=""2""/> </g> </svg> "; var image = new Forms9Patch.Image { Source = Forms9Patch.ImageSource.FromSvgText(svgString), HeightRequest = 200, WidthRequest = 200, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center }; Content = new StackLayout { Children = { image, } };
gives the following results:
Note that Forms9Patch is using SkiaSharp.SVG for SVG rendering. It appears that SkiaSharp.SVG is not handling stroke-linecap correctly.
I'll be updating the NuGet in a day or two.
Sorry, something went wrong.
Version 2.3 has been released. Please let me know if this does not fix this issue.
No branches or pull requests
I'm trying to load a generated svg image. Unfortunately Forms9Patch doesn't allow this; it just taskes ImageSources from local files.
So my workaround is to create a local temporary image and load from this. This works but I would like to read directly from a string.
Is there a possibility to load my SVG directly from memory?
The text was updated successfully, but these errors were encountered: