-
-
Save qhm123/2772933 to your computer and use it in GitHub Desktop.
WebView截图
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Picture picture = webView.capturePicture(); | |
int weight = picture.getWidth(); | |
int height = picture.getHeight(); | |
if (weight > 0 && height > 0) { | |
Bitmap bitmap = Bitmap.createBitmap(weight, height, | |
Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(bitmap); | |
picture.draw(canvas); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment