Displaying images as a stream from a WCF service

In the previous recipe, we looked at how we could send files to a server using a WCF service that lies in between. The data is sent in that scenario as a stream of bytes.

Instead of uploading files, we may also come across a situation where a service sends data such as images in the form of binary data (instead of just sending a link to the file). This can be the case if the files are stored in a database in binary format. In this recipe, we'll look at exactly this.

Getting ready

A starter solution containing some sample images is provided in the code bundle available on the Packt website. This solution can be found in the Chapter07/SilverlightImageDownload_Starter directory. The complete code for ...

Get Silverlight 4 Data and Services Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.