Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
Nobody

C#
[C#/wpf]Image Does Not Show

10 posts in this topic

I'm trying to make an Image control contain an image, and it is not working. You can see it is the VE but when you debug the picture does not show. Here is the XAML code:


<Image x:Name="stfsTool" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="182" Margin="20,91,0,0" Source="pack://siteoforigin:,,,/Resources/STFSTool.jpg" MouseUp="stfsTool_MouseUp"/>

Share this post


Link to post
Share on other sites

Change the Source attribute to;

Source="/app_default_namespace;component/Resources/STFSTool.jpg"

Then, make sure the Image has a 'Build Action' of 'Resource'.

IHV-LS.png

Share this post


Link to post
Share on other sites

Change the Source attribute to;

Source="/app_default_namespace;component/Resources/STFSTool.jpg"

Then, make sure the Image has a 'Build Action' of 'Resource'.

IHV-LS.png

I'm in Visual Studio, not Blend so I changed the Resources property to it instead. I get this error though:

Error 1 Could not find a part of the path 'C:\app_default_namespace;component\Resources\STFSTool.png'. C:\Users\Iysac\documents\visual studio 2012\Projects\Xenon\Xenon\Mainwindow.xaml 34 137 Xenon

Edited by Nobody

Share this post


Link to post
Share on other sites

I'm in Visual Studio, not Blend so I changed the Resources property to it instead. I get this error though:

Error 1 Could not find a part of the path 'C:\app_default_namespace;component\Resources\STFSTool.png'. C:\Users\Iysac\documents\visual studio 2012\Projects\Xenon\Xenon\Mainwindow.xaml 34 137 Xenon

You're loading the image from the C drive?.. Why? Import it into a folder called "Resources" in Visual Studio and label it as 'Resource'.

Share this post


Link to post
Share on other sites

You're loading the image from the C drive?.. Why? Import it into a folder called "Resources" in Visual Studio and label it as 'Resource'.

It is?

e4335327bc7f2164b69fd12929d93ba3.png

Share this post


Link to post
Share on other sites

It is?

e4335327bc7f2164b69fd12929d93ba3.png

Oh, you were suppose to change "app_default_namespace" to the applications default namespace.

Share this post


Link to post
Share on other sites

Oh, you were suppose to change "app_default_namespace" to the applications default namespace.

Still turns up empty on debug.

Share this post


Link to post
Share on other sites

Still turns up empty on debug.

Oh, and your image is a .png, you're calling a .jpg in the xaml.

Share this post


Link to post
Share on other sites

Oh, and your image is a .png, you're calling a .jpg in the xaml.

No, I changed that.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0