开发者

Webcam resolution problem

I've submitted the question today, which was correctly resolved, but I have another issue.

I want the webcam to be 640x480 and it's working, and I want to save it at 640x480 but it's currently saving at 320x240!!

This is the code.

var bandwidth:int = 0; 
var quality:int = 100;


var cam:Camera = Camera.getCamera();
if(cam==null)
 trace("err")
else
{
 cam.addEventListener(StatusEvent.STATUS,statusHandler);
function statusHandler(evt:StatusEvent):void
{
 if(cam.muted)
 {
 }
 else
 {
  trace(cam.width)

 }
}


cam.setQuality(bandwidth, quality);
cam.setMode(8192,6144,30,false); // setMode(videoWidth, videoHeight, video fps, favor area)

var videoToCapture:Video = new Video();
videoToCapture.attachCamera(cam);
videoToCapture.width=640;
videoToCapture.height=480;
videoToCapture.x = 12;
videoT开发者_高级运维oCapture.y = 13;
addChild(videoToCapture);

var bitmapDataToCapture:BitmapData = new BitmapData(videoToCapture.width, videoToCapture.height, false, 0x000000);
var bitmapToCapture:Bitmap = new Bitmap(bitmapDataToCapture);
addChild(bitmapToCapture);
bitmapToCapture.x=700;
bitmapToCapture.y=13;





capture_mc.buttonMode = true;
capture_mc.mouseChildren=false; 
capture_mc.addEventListener(MouseEvent.CLICK,captureImage);




function captureImage(e:MouseEvent):void 
{   
 bitmapDataToCapture.draw(videoToCapture);
 //bitmapDataToSend.draw(videoToSend);
} 

You can see the problem by looking at this..

http://img233.imageshack.us/i/imgmib.jpg/

Thanks for any appreciated help..


Change this line

cam.setMode(8192,6144,30,false);

to this

cam.setMode(640,480,30,false);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜