如何在银色光下将图像保存在文件夹中 [英] How to save image in a folder in silver light

查看:99
本文介绍了如何在银色光下将图像保存在文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在制作银色投影项目.在这种情况下,我需要上传图片并将其保存在服务器的文件夹中(即应用程序的文件夹中).我希望通过单击按钮即可完成此功能.因此,我无法使用文件上传控件.为了获得图像,我使用了打开对话框.现在我要说说图像.

如果有人有任何将图像保存到文件夹的想法,请回复我.


先谢谢了.

Hi,

I am working on a silver light projrct.In this I need to upload an image and save it in a folder in the server(i.e., in a folder in the application). I want this funtion to be done on button click. So I cannot use file upload control. For getting the images I used open dialog. Now I have to sae the image.

If anyone have any idea to save the image to folder please reply me.


Thanks in advance.

推荐答案

如果您使用OpenFileDialog选择文件,那么您将获得流,对吗?

因此,您可以将此流http发送到您的Web服务.

请检查以下示例:

Silverlight文件上传 [ ^ ]

注意:不使用任何Web服务都是不可能的.

If you are selecting a file by using OpenFileDialog then you will get the stream, right?

So, you can do http-post this stream to your web service.

Please check this example:

Silverlight File Upload[^]

Note: It''s not possible to do without using any web service.


您将需要在服务器端连接WCF服务.该服务将获取文件信息和字节数组,然后将其存储在本地.

在您的Silverlight应用程序中,您将引用该服务,然后获取图像数据并将其发送.

要获取图像数据,最有可能将其发送到WriteableBitmap中,然后解析Pixels数组...您可以在Silverlight端对其进行格式化并将其向下发送,或将其发送服务器上的原始格式和句柄格式.也许在客户端进行简单压缩,然后在服务器上解压缩并格式化为JPEG/PNG/etc就可以了.

You''ll need to wire in a WCF service at the server side. The service would take the file information and byte array, then store it locally.

In your Silverlight application, you''ll reference the service, then take your image data and send it.

To get to the image data, most likely you''ll send it into a WriteableBitmap and then parse the Pixels array ... you can either format it on the Silverlight side and send it down, or send it raw and handle formatting on the server. Perhaps simple compression in the client, then uncompress and format into JPEG/PNG/etc on the server would be fine.


查看此内容: ^ ]


这篇关于如何在银色光下将图像保存在文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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