Question

I have created an image to use as a ruler. It has black lines and text on a transparent background and is in PNG format. After adding it to my XAML I was surprised to find that the image was not visible, and even more surprised to find it was visible in Blend when I loaded the XAML file there.

What might cause an image to be invisible when running the application, even though it is visible in Blend at design time?

Was it helpful?

Solution 2

It turns out that I was being stupid, which sadly happens more than I'd like. I had placed the image in the Images folder on disk but had neglected to add it to the project as a resource. Simply doing so has the image appearing, as expected.

OTHER TIPS

It might have to do with the image path or reference. Can you include some XAML or source code to show how you're setting the image source?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top