我越来越黑屏不是视频内容请帮助我。如何在android中播放视频时拍摄videoview的快照?
我的代码:
private Bitmap takeScreenshot() {
relate.setDrawingCacheEnabled(true);
relate.buildDrawingCache();
return relate.getDrawingCache();
}
private void saveBitmap(Bitmap bitmap) {
// File imagePath = new File(Environment.getExternalStorageDirectory() + "/screenshot.png");
FileOutputStream fos;
// String path ="data/data/com.focusmedica.eyeactivity/files/Images" + filename;
try {
fos =new FileOutputStream(path);
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.flush();
fos.close();
sentmail(path);
} catch (FileNotFoundException e) {
Log.e("GREC", e.getMessage(), e);
} catch (IOException e) {
Log.e("GREC", e.getMessage(), e);
}
}
我使用canvas
对videoview
绘制的东西。而我只得到黑屏。 my videoview
在relative layout
之内。 感谢提前.....
你使用的是surfaceview还是textureview? – GvSharma
不,我没有使用这两个,其实我是新的android所以我不知道这件事情... @ gvsharma –