Taking a screenshot of the view
See original GitHub issueHere’s my hierarchy:
CardView
|
-> ImageView
When I call
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
view.draw(canvas);
it dumps the cardview
and its contents into the bitmap just how I’d like it.
After replacing the imageview
with the youtubeplayerview
, all i get is a black screen. On setting drawingCacheEnabled()
, the controls of the video show up, but the video part remains black. Any clue why?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
android - Take a screenshot of a whole View
Actually I found the answer: public static Bitmap loadBitmapFromView(View v) { Bitmap b = Bitmap.createBitmap(v.getWidth() , v.
Read more >How to Take a Screenshot on Any Phone or Laptop
To capture screenshots and automatically save them, press the Windows and Print Screen keys together. Screenshots are saved in a folder titled ...
Read more >How to Take a Screenshot on Any Device
Open the Watch app on your iPhone, and navigate to My Watch > General > Enable Screenshots and toggle it on, or open...
Read more >How to Take a Screenshot on your PC, Phone or Tablet
This screenshot will be automatically saved to your desktop. Press the Command, Shift and 4 keys together to take a screenshot of a...
Read more >How to Capture Screenshot of a View and Save it ...
How to Capture Screenshot of a View and Save it to Gallery in Android? · Step 1: Create a new project · Step...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Let me know if you find a solution, could be useful to other users in the future 😃
@crearo please share the solution. we are also stuck