actionscript 3 - snapshot from webcam white border -
using flash, i'm talking picture user's webcam , saving image.
the image ends white borders on right , bottom edges, however.
i tried follow this solution, made white borders smaller, better, want them gone.
here code draws 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 like:
m.scale(400/(mycam.width-40),300/(mycam.height-25));
to temporarily remove white borders, webcams, on macbook, doesn't work. how rid of these white borders?
try capturing video @ other resolutions:
mycam.setmode(320,240,15);
i think want find "sweet spot" work nicely w/most web cams. default capture resolution 160x120. try resolutions multiples of this: 640x480, 480x360, etc.
if tell flash player use capture resolution web camera not support (like maybe 400x300), flash player find closest resolution camera supports... , i'm guessing what's causing white borders.
Comments
Post a Comment