使用Java脚本将图像从Java Applet传输到Asp.net页面 [英] Transfering Image from java applet to an Asp.net page using Java Script

查看:63
本文介绍了使用Java脚本将图像从Java Applet传输到Asp.net页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的伙计们,

我真的很麻烦.需要您的帮助.我正在使用ASP.net项目通过OCR扫描器创建一个接口.为此,我正在使用Java Applet在本地访问扫描器并处理文档.处理文档并将信息传递到ASP页中的Java脚本.但是图像我以字节[]的形式传输.我无法将字节[]从Java脚本转换为ASP.net页中的图像.

Dear Guys,

I am really in a trouble.I need your help.I am creating an interface from a OCR scanner with an ASP.net project.For that i am using a java applet to access the scanner locally and process the document.I am able to process the document and pass the information to the java script in the ASP page.But image i am transferring as byte[].I am not able convert the byte[] from the java script to image in ASP.net page.How can i do that.

推荐答案



您是将字节直接从applet直接流到javascript吗?如果这样,您将无法直接显示图像.

您的选择是,从applet将base64编码的图像形式发送到javascript.将base64发送到服务器,然后使用response.BinaryWrite将其作为图像发送回并显示.

Response.ContentType =图像/gif"
Response.BinaryWrite(byteStream)

如果您能够修改小程序,请执行与上述相同的操作,而不是将图像传输到javascript.
Hi,

Are you streaming just the bytes directly from applet to javascript.If so you''ll not be able to directly display the image.

Your options are,from the applet send the base64 encoded form of image to javascript.Post the base64 to the server and then use response.BinaryWrite to send back it as image and display it.

Response.ContentType = "image/gif"
Response.BinaryWrite(byteStream)

If you are able to modify the applet do the same thing as above instead of transferring the image to javascript.


这篇关于使用Java脚本将图像从Java Applet传输到Asp.net页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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