Page view counter
Silverlight - Get images as stream from file server Subscribe to this thread
Last post 03-09-2009 1:41 PM by hariram.p@live.in. 4 replies.
Sort Posts:
01-06-2009 5:54 AM
Silverlight - Get images as stream from file server

I have a file server conatining DICOM(image) files. I need to connect to that server & get all the images as stream. the images will be residing on a path on the file server. How do I do this in SIlverlight?

 Thanks,

Rajeev

Rajeev_BV

Loading...
Joined on 11-19-2008
Bangalore
Posts 22
01-06-2009 6:44 AM
Re: Silverlight - Get images as stream from file server

to get something as stream (also image) use webclient and openreadcompleted event

Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
       Dim req As New WebClient
       AddHandler req.OpenReadCompleted, AddressOf fertig
       req.OpenReadAsync(New Uri("ppedv.jpg", UriKind.Relative))
End Sub

 Public Sub fertig(ByVal sender As Object, ByVal e As OpenReadCompletedEventArgs)
        Dim st As Stream = e.Result
        Dim img As BitmapImage = New BitmapImage()
        img.SetSource(e.Result)
        image1.Source = img
End Sub

-Hannes

http://www.preishuber.net http://weblogs.asp.net/hpreishuber

preishuber

Loading...
Joined on 09-20-2002
Austria/Germany
Posts 434
01-06-2009 10:37 AM
Re: Re: Silverlight - Get images as stream from file server
But I need to get all the images in the folder. If all the images exist in images folder, I need to get all those & get them as stream
Rajeev BV

Loading...
Joined on 10-15-2008
Posts 34
01-06-2009 10:56 AM
Re: Re: Silverlight - Get images as stream from file server

there is no "list driectory on server" function.

1) use a webmethod and implement it

2) enable directory listing in iis (if no default document is displayed) and parse the result

-Hannes

http://www.preishuber.net http://weblogs.asp.net/hpreishuber

preishuber

Loading...
Joined on 09-20-2002
Austria/Germany
Posts 434
03-09-2009 1:41 PM
Re: Re: Silverlight - Get images as stream from file server

Hi,

Creat a web service you give list with custom object to list directory structure like List<String>. In this you can add the directory list from DirectoryInfo.GetFiles()

and bind the service with Silverlight List control. In the list control use SelectionChanged to show the image in different size.

Thanks

Hari

 

Thanks
Hari
---------------------------------------------
Dont forget to click "Mark as Answer" on the post that helped you.

My Site

hariram.p@live.in

Loading...
Joined on 03-07-2009
Posts 49
Microsoft Communities