快速或异步AS3 JPEG编码 [英] Fast or asynchronous AS3 JPEG encoding

查看:211
本文介绍了快速或异步AS3 JPEG编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用的 JPGEn codeR 从AS3核心LIB为en codea的位图JPEG

I'm currently using the JPGEncoder from the AS3 core lib to encode a bitmap to JPEG

 var enc:JPGEncoder = new JPGEncoder(90);
 var jpg:ByteArray = enc.encode(bitmap);

由于位图是相当大(3000×2000)的编码需要很长一段时间(约20秒),从而导致应用程序看起来冻结,而编码。为了解决这个问题,我需要两种:

Because the bitmap is rather large (3000 x 2000) the encoding takes a long while (about 20 seconds), causing the application to seemingly freeze while encoding. To solve this, I need either:

  • 在异步连接codeR这样我就可以不断更新屏幕(进度条什么的),而编码
  • 在另一种连接codeR这简直就是快

或者是可能的,我该怎么办呢?

Is either possible, and how can I do it?

推荐答案

设置的EN codeR是异步的很可能是你最好的选择。

Setting up the encoder to be asynchronous would likely be your best bet.

下面是 2 范例从Adobe

Here are two examples from Adobe

这个例子是用ActionScript /弯曲,但其同样的想法。

This example is with actionscript/flex, but its the same idea.

这篇关于快速或异步AS3 JPEG编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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