我正在尝试基于网络摄像头的应用程序.我开始这样的代码:
import flash.media.Camera; import flash.media.Video; var cam:Camera = Camera.getCamera(); a.vid1.attachCamera(cam); a.vid1.smoothing = true;
我的问题是视频的质量.
我正在使用iMac机器,其中相机质量很好.
有没有办法提高相机输出的质量?
谢谢您的帮助.
解决方法
这是一个示例代码
package { import flash.display.DisplayObject; import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.ActivityEvent; import flash.events.MouseEvent; import flash.media.Camera; import flash.media.Video; public class iosTest extends Sprite { private var cam:Camera; private var vid:Video; public function iosTest() { super(); // support autoOrients stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; cam = Camera.getCamera(); if (!cam) { trace("No camera is installed."); } else { connectCamera(); } } private function connectCamera():void { cam.setMode(640,480,25); cam.setQuality(0,100); vid = new Video(); vid.width = cam.width; vid.height = cam.height; vid.attachCamera(cam); addChild(vid); stage.addEventListener(MouseEvent.CLICK,clickHandler); } private function clickHandler(e:MouseEvent):void { return; switch (cam.width) { case 160: cam.setMode(320,240,10); break; case 320: cam.setMode(640,5); break; default: cam.setMode(160,120,15); break; } removeChild(vid); connectCamera(); } } }