Loading And displaying an image using WCF in Silverlight

Take the following steps to start a project and to add some code that will demonstrate how to consume LEADTOOLS WCF Services from a Silverlight application to load and display images. LEADTOOLS includes native Silverlight codecs for most formats so most image formats can be decoded and viewed natively within the Silverlight application without the WCF Service. In cases where your application needs to load a format for which LEADTOOLS does not provide a native Silverlight codec however, you can still use LEADTOOLS WCF Services to decode the image on the server and send the image back in a format which LEADTOOLS provides a native codec for.

In the "Solution Explorer" window, right-click on the Silverlight project and select Add Service Reference from the context menu. Enter the location where the LEADTOOLS RasterService is being hosted. By default LEADTOOLS installation will host all services in 'http://localhost/LEADTOOLSWCFServices/RasterService.svc'. Enter "LEADTOOLSWCF" for the namespace and click OK. For more information on hosting and consuming LEADTOOLS WCF services, refer to WCF Tutorials.

Switch to MainPage.xaml code view (right-click MainPage.xaml in the solution explorer then select View Code) and add the following lines at the beginning of the file: