我正嘗試將我的SurfaceView(相機預覽)轉換爲位圖以便在飛行中進行人臉檢測。我收到一張非空圖像,但是當我將它顯示在視圖上時,它看起來很純黑。任何想法可能是什麼原因以及如何進行?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));
}
};
做ü有任何解決方案,我也越來越普通的空白圖像。 – CoDe 2012-08-13 07:05:57