• Flash Builder 初试(三) 使用摄像头


    本程序演示了,如何调用本地摄像头,并显示在FLASH中

                import flash.media.Camera;
                
                import mx.events.FlexEvent;
                
                private var camera:Camera;
                private var video:Video;
                
                protected function btnCamera_clickHandler(event:MouseEvent):void
                {
                    // TODO Auto-generated method stub
                    if(Camera.isSupported==true)
                    {
                        camera=Camera.getCamera();
                        camera.setMode(320,240,15,true);
                        sve.width=camera.width;
                        sve.height=camera.height;
                        video=new Video(camera.width,camera.height);
                        video.attachCamera(camera);
                        sve.addChild(video);
                        this.lab_info.text="摄像头 ["+camera.name+"] 已经打开";
                    }
                    else
                    {
                        this.lab_info.text="系统不支持摄像头!";
                    }
                }
        <s:SpriteVisualElement id="sve" x="10" y="39" width="100" height="100"/>
        <s:Button id="btnCamera" x="10" y="10" label="打开摄像头" click="btnCamera_clickHandler(event)"/>
        <s:Label id="lab_info" x="98" y="19"/>
  • 相关阅读:
    Python 对象的绑定方法
    Python 类的属性
    Python 对象与类
    Python 面向对象
    Python Subprocess模块
    Python Hashlib模块
    Python Configparser模块
    Python XML模块
    Python Re模块
    Gridview中Datakeys 通过主键取得各列的值。(转)
  • 原文地址:https://www.cnblogs.com/taobox/p/2959390.html
Copyright © 2020-2023  润新知