Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

wpf load svg?

is there any way i can load an svg onto my wpf form? been stuck on this for hours, would really appreciate some help.

im using it to load a logo onto my form, since when i convert it to png it loses a lot of quality
I've heard good things about SVGImage before, but I've never personally used it:
https://github.com/dotnetprojects/SVGImage
Install ShapVectors

Add the namespace :

Code
xmlns:sharpVectors="http://sharpvectors.codeplex.com/svgc/"

Then you have two common ways to use SVG files.

1. Using the library tags.



2. Using the image tag.

Add the namespace :

Code
xmlns:sys="clr-namespace:System;assembly=mscorlib"

Define the resource key in a window or user-control resources



Then



Note: in Svg file properties >
Build Action: Content or Resource

Copy To Output Directory: Copy if newer Or Copy Always.
[Image: narwinsig.gif]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by ElectronMar 15, 2021 11:05 AM 4 459 Mar 15, 2021 11:05 AM
Last Post: Jaque
[C#] by ObistoneOct 17, 2020 12:05 PM 10 423 Oct 17, 2020 12:05 PM
Last Post: Narwin
[C#] by draxyeeSep 4, 2020 02:41 AM 12 316 Sep 4, 2020 02:41 AM
Last Post: xHeaven