自定义图像的HTMLLoader [英] Custom images for HTMLLoader

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

问题描述

有强大的的HTMLLoader 部分空气包裹在 MX:HTML 为Flex的

There is powerful HTMLLoader component for AIR wrapped in mx:HTML for Flex.

我要手动提供的图像(最好从字节) MX:HTML,这将显示我生成的内容。问题的关键是收拾所有的资源在没有外部文件的应用程序。我可以包不同的html页面中的应用程序,切换他们时, MX:HTML 调度 Event.LOCATION_CHANGE 现在我想相同的图像。你有什么建议?

I want to supply images manually (ideally from bytes) for mx:HTML, which will display my generated content. The point is to pack all resources in the application without external files. I can pack different html pages in the app and switch them when mx:HTML dispatches Event.LOCATION_CHANGE. Now I want the same for images. What do you suggest?

推荐答案

解决经过几个阶段去了!

  1. 请HTMLLoader对象的背景透明与 paintsDefaultBackground =假 backgroundAlpha =0。获取图片的位置用JavaScript通知,并吸引他们在HTMLLoader中的图形。这是复杂的,有问题的调整(图片得到转移),但几乎做了...
  2. 在接下来的想法 - 使用<画布>对他们绘制图像,将数据发送到JavaScript的。
  3. 在阅读帆布教程,偶然发现了数据URI方案,这不正是我需要在最简单的可能方式。图像在base64编码嵌入在HTML页面。
  1. Make HTMLLoader's background transparent with paintsDefaultBackground="false" and backgroundAlpha="0". Get notified of pictures location with javascript and draw them on HTMLLoader's graphics. This is complex and has problems with resizing (pictures get shifted), but was almost done...
  2. Next idea - use <canvas> to draw images on them, sending data to javascript.
  3. While reading canvas tutorials, stumbled upon data URI scheme, which does exactly what I needed in simplest possible way. Images are embedded in html page in base64 encoding.

这篇关于自定义图像的HTMLLoader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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