AIR BitmapData.draw lento

I am working with large bitmapdata that I need to resize, doing some test I realized that the same code runs tooooo slow in AIR.

Este es el código:

import flash.display.BitmapData;
import flash.geom.Matrix;
import flash.display.Bitmap;
import flash.geom.Point;

var MAX_BITMAP_SIZE:Point = new Point( 596, 842 );

var bitmapdata:BitmapData = new MyBitmap();
var sc:Number = Math.min( MAX_BITMAP_SIZE.x / bitmapdata.width, MAX_BITMAP_SIZE.y /     bitmapdata.height );
var outBitmap:BitmapData = new BitmapData( bitmapdata.width >> 1, bitmapdata.height >> 1, false, 0x0 );
var bitmap:Bitmap = new Bitmap();
addChild( bitmap );
var scaleMatrix:Matrix = new Matrix();

var time:Number = new Date().getTime();
outBitmap.draw( bitmapdata, scaleMatrix, null,null,null,true );
trace( new Date().getTime()-time );
bitmap.bitmapData = outBitmap;

The same code tests:

Publish as flash 11.4 -> 1ms Publish as AIR 3.4 ->62ms


preguntado el 28 de agosto de 12 a las 13:08

Have you tried drawWithQuality, setting a lower quality than the default one? -

Yes, I have test with StageQuality.LOW but the results are the same. -

and isn't scaling the Bitmap (DisplayObject) itself faster and smoother? -

No, really is a strange behaviour. Why publish to flash player gives me 1ms and the same code compiled to Desktop Air gets 63ms. -

Ummm, figured out why... I was testing inside Flash IDE, but testing in browser gives me 46ms... anyway it gets 62ms in AIR app... strange anyway... -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.