【发布时间】:2009-08-14 07:11:42
【问题描述】:
据我所知,Android 模拟器没有摄像头。要捕获实时图像,我们必须使用网络摄像头。我在这个web site 中看到了使用android 模拟器中的网络摄像头捕获图像的代码,但我不知道如何使用此代码。
【问题讨论】:
据我所知,Android 模拟器没有摄像头。要捕获实时图像,我们必须使用网络摄像头。我在这个web site 中看到了使用android 模拟器中的网络摄像头捕获图像的代码,但我不知道如何使用此代码。
【问题讨论】:
CameraSource cs = new SocketCamera("192.168.0.100", 9889, 320, 240, true); if (!cs.open()) { /* deal with failure to obtain camera */ } while(/*some condition*/) { cs.capture(canvas) //capture the frame onto the canvas } cs.close();
PS:我无法对此进行测试,因为我在运行 WebcamBroadcaster 时遇到错误。
PPS:我今天才开始尝试 Android,所以这一切都可能是错误的。
【讨论】:
width和height分别替换为getWidth()和getHeight()。
Unable to find a suitable player。可能是什么问题?