I add a folder of image files in my silverli开发者_Go百科ght application. I want to put name of these files (jpg file) to arraylist. How can I access to these files in silverlight 3?
You could use the openFileDialog class if you are accessing files on your server.
http://msdn.microsoft.com/en-us/library/cc221415%28v=vs.95%29.aspx
This gives a good intro to how it works. You're going to have to write the logic of changing the stream into a BitmapImage. But that only 3 lines of code. I'll supply it if you want it.
However if you just want to access images within the application all you need to do is accesses them within the application by creating them as a new bitmapimage:
Image image = new Image();
image.Source = new BitMapImage(new Uri("imagesFolder/yourImageName.jpg",UriKind.RelativeOrAbsolute));
//set the height and width properties afterwards
精彩评论