ActionScript 管理空中摄像机应用程序
有谁知道由attachCamera()调度的事件的名称,我想在相机加载时拍照,我尝试在调用attachCamera后执行我的代码,但它使VideoDisplay为空,这就是为什么我会想知道在 Attachcamera() 完成加载后是否触发了一个事件。
Does anyone know the name of the event that is dispatch by the attachCamera(), i would like to take a picture ones the camera is loaded, i try to execute my code after call attachCamera but it takes the VideoDisplay empty, that's why i would like to know if there is an event triggered after the attachcamera() is complete loeaded.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要“拍摄”照片,您需要绘制位图,该位图使用相机输入作为源。您必须定义位图容器的 x/y 并将其放置在其中...
绘制位图后,您可以对其执行许多操作...取决于您想要的内容。
To "take" a picture, you'll need to draw a bitmap, which uses the camera input as it's source. You must define the x/y of the bitmap container and place it inside...
There are a number of things you can do with the bitmap once it's drawn...Depends on what you want.
您可以通过查看此 Adobe 文档中关于 Camera 类的示例。此外,研究如何使用 Video 对于了解 Air 的使用方式也很有用可能会使用相机提要(这依赖于使用 视频类,当然)。
You can see how the camera activity might work by looking at this example in the Adobe docs on the Camera class. Also, researching how to use Video is useful in understanding how Air might use the camera feed (this relies on using the Video class, of course).
计时器可以工作,但更直接的解决方案是在调用 Video.attachCamera() 后处理由 Camera 实例分派的第一个 ActivityEvent。像这样:
编辑:有些相机需要一些时间来初始化,因此在 ActivityEvent.ACTIVITY 之后捕获第一帧会导致空白帧。添加了短暂的超时来解决此问题。
A timer will work, but a more direct solution is to handle the first ActivityEvent dispatched by the Camera instance after Video.attachCamera() is called. Like so:
EDIT: Some cameras take a bit of time to initialize, so capturing the first frame after ActivityEvent.ACTIVITY results in a blank frame. Added a brief timeout to address this.