【发布时间】:2010-09-26 19:50:58
【问题描述】:
我正在尝试将我的 SurfaceView(相机预览)转换为位图以进行动态人脸检测。我收到一个非空图像,但是当我将它显示到视图上时,它看起来是纯黑色的。任何想法可能是什么原因以及如何进行?
(我认为从 SurfaceView 中提取位图很困难但并非不可能 - 但没有人发布任何解决方案)
class BackgroundView extends SurfaceView implements SurfaceHolder.Callback {
public BackgroundView(Context context) {
super(context);
// ...
setDrawingCacheEnabled(true);
}
// ...
}
private Runnable update = new Runnable() {
public void run() {
// Following statement is sending a black/blank image
faceView.updateFaces(backgroundView.getDrawingCache());
mHandler.postDelayed(update, (long) (1000));
}
};
【问题讨论】:
-
你有什么解决方案吗,我也得到了纯空白图像。
标签: android bitmap surfaceview