发送ByteArray的的JavaScript [英] Send ByteArray to JavaScript

查看:324
本文介绍了发送ByteArray的的JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何发送JPG图片为的ByteArray 从AS3的JavaScript?以及如何将的ByteArray 图像在JavaScript?

How to send a jpg image as ByteArray from as3 to javascript? And how to convert ByteArray to image in javascript?

推荐答案

目前的Web浏览器中的JavaScript和DOM实现真的没有做这样的事情很好的机制。

The JavaScript and DOM implementations of current web browsers don't really have good mechanisms for doing this sort of thing.

您最好的选择是让你的AS3返回的数据协议的URI与一个base64-CN $ C $图像的光盘版。现代浏览器(IE8 +,FF2 +等)将接受一个数据URI作为一个IMG标签的SRC,将使得其中包含的图像。

Your best bet is to have your AS3 return a DATA protocol URI with a base64-encoded version of the image. Modern browsers (IE8+, FF2+, etc) will accept a DATA URI as the SRC of an IMG tag and will render the image contained therein.

http://en.wikipedia.org/wiki/Data_URI_scheme

你必须有一个AS3专家解释如何把一个字节数组转换成一个base64-CN codeD字符串,但它不可能是那么难。

You'll have to have a AS3 expert explain how to turn an byte-array into a base64-encoded string, but it cannot be that hard.

这篇关于发送ByteArray的的JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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