WCF服务传递图像以供Silverlight使用 [英] WCF service passing images to be consumed by Silverlight

查看:75
本文介绍了WCF服务传递图像以供Silverlight使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我是Silverlight的新手.我正在寻找一个可以向我展示如何使用Silverlight从WCF服务使用图像的教程.
我希望实现的是:
有一个WCF可以访问数据库并可能处理一些getImage方法.
我希望基于Silverlight的客户端调用方法并公开图像.

我希望可以实现.

非常感谢

Hi guys

I am new to silverlight. I am looking for a tutorial that can show me how to consume images from WCF service using Silverlight.
What I am hoping to achieve is:
Have a WCF that accesses a database and possibly handle some getImage methods.
I would want a Silverlight based client to call the methods and expose the images.

I hope this can be achieved.

Many thanks

推荐答案

Here is a good sample that you help you start your project.


您好,

您存储在数据库中的内容是什么?是图像位置(表示完整路径)还是图像作为流?

如果它是图像路径,则将该路径作为字符串发送给客户端,然后将其分配给图像源,或者使用WebClient下载图像并将其设置为图像源.

如果直接将图像存储到数据库中,则将其作为流检索并分配给图像.


让我知道,如果有任何问题.
Hi,

What are you storing in your database? Is it image location (means complete path) or the image as a stream?

If it is the image path, then send the path as a string to your client and then assign it to the Image Source or use WebClient to download the image and set it to the image source.

If you are directly storing the image into your database, then retrieve it as a Stream and assign to your image.


Let me know, if any issues.


这篇关于WCF服务传递图像以供Silverlight使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆