Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using XAML vector graphics in WPF application

I have a vector image that I've defined in XAML. What is the proper way to use this resource in a WPF application?

I want to have the vector image in its own XAML file, and then add the image to other UserControls in my application. What should be the top-level element in my XAML vector image? How do I refer to that image in other UserControls?

like image 630
sourcenouveau Avatar asked Jun 17 '09 13:06

sourcenouveau


People also ask

Does WPF support SVG?

Supported SVG ElementsThe WPF SVG render engine supports the following SVG elements: Path - <path>

Which graphics technology does WPF utilize?

WPF uses vector graphics as its rendering data format. Vector graphics—which include Scalable Vector Graphics (SVG), Windows metafiles (.

Is WPF still in demand?

WPF is still one of the most used app frameworks in use on Windows (right behind WinForms).


1 Answers

http://learnwpf.com/post/2006/06/04/How-do-I-Include-Vector-Based-Image-Resources-in-my-WPF-Application.aspx explains how to do it.

<ContentControl Template="{StaticResource Credit-Card}" />
like image 171
Lars Truijens Avatar answered Oct 17 '22 06:10

Lars Truijens