Created
August 15, 2014 09:49
-
-
Save terrytowne/7a535791eb0d0819aacc to your computer and use it in GitHub Desktop.
capture a view to bitmap
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
// cache enable flag | |
captureRelativeLayout.setDrawingCacheEnabled(true); | |
bitmap = captureRelativeLayout.getDrawingCache(true).copy(Config.ARGB_8888, false); | |
captureRelativeLayout.destroyDrawingCache(); | |
// build cache | |
captureRelativeLayout.buildDrawingCache(true); | |
bitmap = captureRelativeLayout.getDrawingCache(true).copy(Config.ARGB_8888, false); | |
captureRelativeLayout.destroyDrawingCache(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment