What is the alternative to PictureBox in Silverlight?

I have a PictureBox in my Windows Form application, and I'm in the process of converting my application to Silverlight, and I would like to know what is the alternative to PictureBox in Silverlight, thanks!

+4
source share
3 answers

What you can try is the Viewbox . Then inside the viewport you can place the image. The great thing about Viewbox is that you can always scale everything inside sequentially, even when VB resizes. Or you can use the image as indicated by @Chris, and provided size restrictions and zoom settings.

XAML example:

<Viewbox x:Name="vb"> <Image x:Name="myImage" Source="pathToImage"/> </Viewbox> 

You can then put the Viewbox inside a Stackpanel or Grid to achieve the correct layout. Hope this helps!

0
source

Depending on the functionality of the PictureBox you are using, you can simply use the Image control in Silverlight.

+2
source

Image management is your only choice for this case, but you should be careful that this control simply supports the .jpg and .png extensions, and for other formats you must create or use converters.

+1
source

All Articles