{"id":13698074,"url":"https://github.com/mntone/svgforxaml","last_synced_at":"2026-03-10T02:03:46.504Z","repository":{"id":143416984,"uuid":"47877360","full_name":"mntone/SvgForXaml","owner":"mntone","description":"Draw SVG image with Win2D","archived":false,"fork":false,"pushed_at":"2020-08-26T14:41:50.000Z","size":973,"stargazers_count":92,"open_issues_count":10,"forks_count":18,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-12-05T15:53:04.460Z","etag":null,"topics":["direct2d","draw-images","svg","uwp","win2d","winrt","winrt-uwp","xaml"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mntone.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-12-12T12:29:34.000Z","updated_at":"2025-08-11T14:05:27.000Z","dependencies_parsed_at":"2023-06-17T12:15:51.674Z","dependency_job_id":null,"html_url":"https://github.com/mntone/SvgForXaml","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mntone/SvgForXaml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mntone%2FSvgForXaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mntone%2FSvgForXaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mntone%2FSvgForXaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mntone%2FSvgForXaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mntone","download_url":"https://codeload.github.com/mntone/SvgForXaml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mntone%2FSvgForXaml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30322637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["direct2d","draw-images","svg","uwp","win2d","winrt","winrt-uwp","xaml"],"created_at":"2024-08-02T19:00:39.334Z","updated_at":"2026-03-10T02:03:41.486Z","avatar_url":"https://github.com/mntone.png","language":"C#","funding_links":[],"categories":["UI Library"],"sub_categories":[],"readme":"# Svg for Xaml Library\n\n[![NuGet](https://img.shields.io/nuget/v/Mntone.SvgForXaml.svg?style=flat-square)](https://www.nuget.org/packages/Mntone.SvgForXaml/) [![Downloads](https://img.shields.io/nuget/dt/Mntone.SvgForXaml.svg?style=flat-square)](https://www.nuget.org/packages/Mntone.SvgForXaml/) [![License](https://img.shields.io/github/license/mntone/SvgForXaml.svg?style=flat-square)](https://github.com/mntone/SvgForXaml/blob/master/LICENSE.txt)\n\nDraw images from svg file with Win2D.\n\n\u003cimg src=\"https://github.com/mntone/SvgForXaml/blob/master/images/ss.png\" alt=\"app screenshot\" width=\"464\" height=\"526\"\u003e\n\nTokyo railmaps\n\n\u003cimg src=\"https://github.com/mntone/SvgForXaml/blob/master/images/ss2.png\" alt=\"app screenshot\" width=\"867\" height=\"705\"\u003e\n\nThanks to [railmaps](https://github.com/hashcc/railmaps)\n\n## Requirement\n\n- [Win2D](https://github.com/Microsoft/Win2D)\n\n\n## Usage\n\n### xaml with binding\n\nBinding content type is `SvgDocument`.\n\n```xml\n\u003csvg:SvgImage Content=\"{Binding ...}\" /\u003e\n```\n\n### Renderer a raster image from svg image\n\n```csharp\nvar svg = SvgDocument.Parse(...);\nvar uri = new Uri(\"ms-appdata:///local/filename.jpg\");\nvar file = await StorageFile.GetFileFromApplicationUriAsync(uri);\nawait SvgImageRenderer.RendererImageAsync(file, new SvgImageRendererSettings()\n{\n\tDocument = svg,\n\tFormat = SvgImageRendererFileFormat.Jpeg,\n\tScaling = 10.0F,\n\tQuality = 0.8F,\n});\n```\n\n### Rendering in Win2D ecosystem\n\n```csharp\nvar svg = SvgDocument.Parse(...);\n\nvar width = 24.0F;\nvar height = 24.0F;\nvar scaling = 3.0F;\nvar device = CanvasDevice.GetSharedDevice();\nusing (var offScreen = new CanvasRenderTarget(device, width, height, scaling * 96.0F))\nusing (var renderer = new Win2dRenderer(offScreen, svg))\nusing (var session = offScreen.CreateDrawingSession())\n{\n\tsession.Clear(Colors.Transparent);\n\trenderer.Renderer(width, height, session); // \u003c- rendering svg content\n}\n```\n\n\n## Note\n\n**If you build your app for Windows 10 Aniversary Update or later, you should use SVG API on Direct2D.**\n- Direct2D: https://msdn.microsoft.com/en-us/library/windows/desktop/mt790715.aspx, or\n- Win2D: https://microsoft.github.io/Win2D/html/N_Microsoft_Graphics_Canvas_Svg.htm\n\n\n## LICENSE\n\n[MIT License](https://github.com/mntone/SvgForXaml/blob/master/LICENSE.txt)\n\n\n## Author\n\n- mntone\u003cbr\u003e\n\tGitHub: https://github.com/mntone\u003cbr\u003e\n\tTwitter: https://twitter.com/mntone (posted in Japanese; however, english is ok)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmntone%2Fsvgforxaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmntone%2Fsvgforxaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmntone%2Fsvgforxaml/lists"}