Steve Crane
Steve Crane

Reputation: 4440

Why image with transparent background not visible in Silverlight?

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?

Upvotes: 0

Views: 1192

Answers (2)

Steve Crane
Steve Crane

Reputation: 4440

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.

Upvotes: 0

Jon Galloway
Jon Galloway

Reputation: 53155

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?

Upvotes: 1

Related Questions