Using Flash, I'm talking a picture from the user's webcam and saving it as an image.
The image ends up with white borders on the right and bottom edges, however.
I tried to follow this solution, but that only made the white borders smaller, which is better, but I want them gone.
Here is the code that draws the white borders.
VD1 = new Video();
VD1.width = 400;
VD1.height = 300;
myCam = Camera.getCamera();
myCam.setMode(400,300,15);
VD1.attachCamera(myCam);
var screenshot:BitmapData = new BitmapData(400,300,false);
var m:Matrix = new Matrix();
m.scale(400/(myCam.width),300/(myCam.height));
screenshot.draw(VD1,m);
I can do something like:
m.scale(400/(myCam.width-40),300/(myCam.height-25));
To temporarily remove the white borders, but for certain webcams, like those on a macbook, it doesn't work. How do I get rid of these white borders?