views:

282

answers:

2

How to stretch out the movie clip to twice its width and height after applying some Pixel Bender filter?

I have some object with video on it (for ex 512 by 512) I apply a Pixel Bender Filter on it. Now I want to stretch the result (for ex to 1024 by 1024). How to stretch it?

So my point is 1) Render the result of effect 2) Stretch out the result

(It’s all fore CPU/GPU resources saving so if such operation would not help me to save than please inform me)

A: 

I haven't tried it with PixelBender-ed clips, but does clip.width *= 2; clip.height *= 2; not work as usual in this case?

Cory Petosky
the problem is that if we do clip.width *= 2; clip.height *= 2; our filter will need to render all new resolution we get by this operation (
Blender
What about adding your pixel-bent clip to a container Sprite that has scaleX = 2 and scaleY = 2?
Cory Petosky
+1  A: 

You can create a new Bitmap from it and scale that:

//mv is your movieclip with the filter applied, mine had shadow so i added 20 pixels in size
var bitmapData:BitmapData = new BitmapData(mv.width + 20, mv.height + 20, true, 0x00000000);
bitmapData.draw(mv);

new_mv = new Bitmap(bitmapData);
new_mv.width *= 2;
new_mv.height *= 2;


addChild(new_mv);

You might want to tweak some stuff like smoothing or pixelsnapping

Les