开发者

Embed image to vsix

I'm playing around with the custom start page template in vs.

How would I go about embedding an image that I can use the in the start page xaml. I have tried the normal way of setting the image to Res开发者_如何学Goource and setting the source property on the Image control to the file name.

<Image Source="logo.jpg" />

but it doesn't work...it builds ok and spins up the start page ok, but doesn't show the image. If I stick in a url to the source that works fine.

Thx Steve


If the Build Action is Resource in the Properties window:

<Image Source="pack://application:,,,/AssemblyName;component/Resources/logo.jpg" />

If the Build Action is Content and Include in VSIX is True in the Properties window:

<Image Source="pack://application:,/Resources/logo.jpg" />

Considering the logo.jpg is in the Resources folder.


I believe that if you have to set the Source like this:

<Image Source="pack://application:,,,/logo.jpg" />


You need to set the Source like this

   <Image Source="pack://application:,/Resources/view.png" Margin="5"/>

Then you had to mark the picture in the Properties Section as Content and set the Include in VSIX to True.

Hope that would help, Greetings from Noxum

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜