获取自定义布局的屏幕截图

时间:2016-09-01 01:20:20

标签: android opencv

如何从opencv获取自定义布局的屏幕截图?这个代码是getWindow()。getDecorView()。getRootView()适用于opencv的这个自定义视图;从中获取位图?

 <org.opencv.android.JavaCameraView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:visibility="gone"
    android:id="@+id/activity_java_surface_view"
    opencv:show_fps="true"
    opencv:camera_id="any" />

1 个答案:

答案 0 :(得分:0)

此代码有效吗?

view.setDrawingCacheEnabled(true);
Bitmap b = view.getDrawingCache();
相关问题