How to use xaml vector images as image source in Windows 8 app

前端 未结 2 1528
情歌与酒
情歌与酒 2021-02-20 13:01

I created some assets in inkscape and would like to use them as icons in a windows 8 application. I have done some reading and it seams that while .Net 4.5 supports SVG, the mod

2条回答
  •  抹茶落季
    2021-02-20 13:49

    I'm pretty positive you can't just inject Path Data into an Image Source and expect it to magically work unless it's through a Drawing Object as Source. What you can however do is adopt your Path into a ContentControl for re-use in the same way without having to go through the trouble of Drawing objects for every instance.

    So instead of;

    
    

    Just do something like this and plop it in your Object.Resources or ResourceDictionary;

     
    

    Then just plop it on your view wherever and as many times as you like;

      
    

    You will however want to play with that Path of yours. It seems set a large size, but hopefully this provides a good alternative for your circumstance. Cheers!

提交回复
热议问题