具有外部接口的图像

发布于 2024-07-21 04:44:30 字数 89 浏览 4 评论 0原文

我需要使用外部接口(as3)将图片发送到闪存...不能是网址,因为没有连接...我正在尝试打开图像文件并像文本一样发送到闪存,但没有成功

任何想法?

I need to send a picture to flash with external interface (as3)... can not be an url because don't have connection... I'm trying open the image file and send to flash like text but without success

any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怀中猫帐中妖 2024-07-28 04:44:30

简短的回答是:请不要这样做。

如果必须这样做,那么您需要获取图像数据,使用 HTTP 请求安全的内容(例如 base64)对其进行编码,在闪存中对其进行解码,将其放入字节数组中并从中重新制作位图。 这相当复杂。

http://dynamicflash.com/goodies/base64/ 是一个用于解码 Base64 图像的绝佳类字符串转换为字节数组。

Short answer is: Please don't do that.

If you have to, then you'll need to take the image data, encode it with something HTTP request safe like base64, decode it in flash, drop it in a bytearray and remake a Bitmap out of it. This is pretty complicated.

http://dynamicflash.com/goodies/base64/ is a great class for decoding your base64 image string into a bytearray.

病毒体 2024-07-28 04:44:30

尝试提供更多详细信息。 到底应该用什么打开图像文件? 实际上,Flash本身可以打开HDD中的图像文件。

var ldr:Loader = new Loader();
ldr.load(new URLRequest('C:/Images/MyImage.jpg'));
addChild(ldr);

但如果我理解你的麻烦 - 这可能不是一个解决方案? 是吗?

Try to provide more details. What exactly should open image file? Actually, flash itself can open image file from HDD.

var ldr:Loader = new Loader();
ldr.load(new URLRequest('C:/Images/MyImage.jpg'));
addChild(ldr);

But if I understand your trouble - that possibly is not a solution? Is it?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文