Skip to main content
October 27, 2011
Question

bitmapdata.draw and stage3D

  • October 27, 2011
  • 3 replies
  • 2566 views

I have a script that uses a lot of complicated .draw calls with matrix transformation (scale and shift), displaying different parts of a big image (thousands by thousands px) in a kind of navigatior window.

Currently it's done in "old" AS3 for FP10. Is there a way to speed these calls up using GPU and stage3D in the new player FP11?

Can GPU help with that kind of image manupulation?

This topic has been closed for replies.

3 replies

Inspiring
November 4, 2011

Yes, using Stage3D improves performance dramatically.

November 4, 2011

Good news, thank you!

Can anyone tell me what could be a Stage3D equivalent of this:

var img:BitmapData = .......

var rgn:Rectangle = ........

var scl:Number = ....

var matrix:Matrix = new flash.geom.Matrix();

rgn.x *= scl;

rgn.y *= scl;

rgn.width *= scl;

rgn.height *= scl;

matrix.scale(scl,scl);

matrix.tx = -rgn.left;

matrix.ty = -rgn.top;

var mapBD:BitmapData = new BitmapData(rgn.width,rgn.height,false,0x000000);

mapBD.draw(img,matrix,null,null,new Rectangle(0,0,rgn.width,rgn.height),true);

var mapLayer:Bitmap = new Bitmap(mapBD);

Inspiring
November 4, 2011

You need to use shaders or AGAL (which, essentially a runtime shader). There is no direct correlation between regular AS3 bitmapdata manipulations and Stage3D.

November 4, 2011

Another bump... can not believe nobody knows this...

October 30, 2011

Anyone?

Are there any Adobe developers here who might know the answer?