搞了个免驱的摄像头,写了个程序来测试一下。
代码:
代码
package
{
import flash.display.Sprite;
import flash.media.Camera;
import flash.media.Video;
public class TestAsCam extends Sprite
{
private var cam:Camera;
private var video:Video;
public function main(): void
{
}
public function TestAsCam()
{
Init();
}
private function Init() : void
{
cam = Camera.getCamera();
if (cam != null )
{
cam.setMode( 800 , 600 , 5 );
// cam.setQuality(0,100);
video = new Video( 800 , 600 );
video.attachCamera(cam);
this .addChild(video);
video.x = 0 ;
video.y = 0 ;
}
}
}
}
{
import flash.display.Sprite;
import flash.media.Camera;
import flash.media.Video;
public class TestAsCam extends Sprite
{
private var cam:Camera;
private var video:Video;
public function main(): void
{
}
public function TestAsCam()
{
Init();
}
private function Init() : void
{
cam = Camera.getCamera();
if (cam != null )
{
cam.setMode( 800 , 600 , 5 );
// cam.setQuality(0,100);
video = new Video( 800 , 600 );
video.attachCamera(cam);
this .addChild(video);
video.x = 0 ;
video.y = 0 ;
}
}
}
}
考虑开发一些和摄像头有关的应用。目前看来,分辨率还是不行啊。
本文转自xiaotie博客园博客,原文链接http://www.cnblogs.com/xiaotie/archive/2010/01/23/1654729.html如需转载请自行联系原作者
xiaotie 集异璧实验室(GEBLAB)