mattprecious / telescope

A simple tool to allow easy bug report capturing within your app.
Apache License 2.0
1.18k stars 116 forks source link

Camera preview screenshot #18

Closed UngureanEugen closed 7 years ago

UngureanEugen commented 9 years ago

Then i try to take screenshot from camera preview, it take black screen. How to fix it ?

mattprecious commented 9 years ago

There's a very good chance that the view you're using doesn't update its drawing cache, so the method that Telescope uses to take screenshots won't work. You would have to extend TelescopeLayout and do some hackery to get your view to draw something to the canvas when a screenshot is being taken. I've never done anything with camera previews before so I'll have to look into it.

mattprecious commented 7 years ago

The APIs have been updated to allow you to hook into the screenshot callback and make this work. See SampleMapsView.java for an example of how this was done for a map view.

For camera preview you'll do something very similar but will capture either the previous or next preview frame and insert it into the screenshot.