There seems to be lot of ways on how to load an image and do upload.
On one of my first attempts to do it I thought I have done it ok. It seemed so as when I test it on my machine and upload to server it was OK.
However recently when trying my app I noticed that there was an error when I try to load image from app on a remote server.
So I put my hands on issue and done some tests.
I ended up with 2 ways on how to load an image to an image content on Silverlight.
On first one I load a BitmapImage; on other one i load a byte[].
There seems to be some buzzy about loading byte[] from stream. I get my byte[] from OpenFileDialog but process should be similar.
public Byte[] fdToByteArray(OpenFileDialog odf)
{
Stream stream = odf.File.OpenRead();
BinaryReader binaryReader = new BinaryReader(stream);
byte[] currentImageInBytes = binaryReader.ReadBytes((int)stream.Length);
stream.Position = 0;
return currentImageInBytes;
}
If someone on intent of testing code I have code here:imageTest
A link to demo.
Enjoy.








thanks for the tutorial, but i am stuck on sintehomg. i believe i have followed your directions correctly but when i check out the page.aspx in sharepoint i get no sign of silverlight and no error shown. The silverlight application i created runs fine. I also dropped the telerik and used a standard silverlight button and got the same results.i did go in and make mime types for silverlight on my iis 6 (application/x-silverlight-2).have you encountered this before, or any idea where i should be looking to fix this?
I did face all sorts of issues like that. It was a real namrtgihe to get Silverlight running in MOSS for the first time. So you’re page doesn’t show any sign of silverlight; white page I assume. Do you get a javascript error in the bottom right corner of your screen if so what does it say? When you right click on the white screen do you get Silverlight menu item? Does your page.aspx inherit masterpage yet or is it just running without a masterpage? If you’re running with masterpage make sure you have added transitional DTD to the HTML definition of your masterpage.