List of usage examples for android.view TextureView getBitmap
public Bitmap getBitmap()
Returns a android.graphics.Bitmap representation of the content of the associated surface texture.
From source file:com.darktalker.cordova.screenshot.Screenshot.java
private Bitmap getBitmap() { Bitmap bitmap = null;//from w ww. j av a 2 s . c o m boolean isCrosswalk = false; try { Class.forName("org.crosswalk.engine.XWalkWebViewEngine"); isCrosswalk = true; } catch (Exception e) { } if (isCrosswalk) { try { TextureView textureView = findXWalkTextureView((ViewGroup) webView.getView()); if (textureView != null) { bitmap = textureView.getBitmap(); return bitmap; } } catch (Exception e) { } } View view = webView.getView().getRootView(); view.setDrawingCacheEnabled(true); bitmap = Bitmap.createBitmap(view.getDrawingCache()); view.setDrawingCacheEnabled(false); return bitmap; }