I have a kiosk that takes peoples images using flash webcam video. We are using a 16:9 camera, but we need the images it takes to be 4:3. So I just made the stage 4:3 and added the video to it, and that solves it on the kiosk UI.
But... I am sending these images over to javascript via a base64 encoded jpg using ExternalInterface, and that works great. However, when I grab a video frame to send over, it is still the 16:9 of course.
So I need to crop the video so that when I grab it (or a display object it is added to), it is just the 4:3 image.
I tried using a mask, but it wouldn't take for some reason.
video = new Video(videoHeight, videoWidth); //backwards on purpose
video.x = -(videoWidth - stage.stageWidth) /2; //Center X
video.y = -(videoHeight - stage.stageHeight) /2; //Center Y
var maskSprite:Sprite = new Sprite();
maskSprite.graphics.drawRect(0,0,640,480);
video.mask(maskSprite);
Any ideas?
var bmd:BitmapData = new BitmapData(video.width, video.height); bmd.draw(video); imagePreview = new Bitmap(bmd); this.addChild(imagePreview);- Adam Meyer