diff options
| author | Mathias Agopian <mathias@google.com> | 2013-03-17 01:05:21 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-03-18 20:27:35 +0000 |
| commit | 49ff2c615e53cd9c3e8b5e4792a68026fb079671 (patch) | |
| tree | 1aece00ec558f0682304ce898b1a86d90d0f73df /core/java/android/view/SurfaceControl.java | |
| parent | 338b18844434379de54050ff582d36ff6da3ba11 (diff) | |
improve SurfaceControl.screenshot documentation
Change-Id: I7e17f69f74df8610b5b85fac0127727df973be42
Diffstat (limited to 'core/java/android/view/SurfaceControl.java')
| -rw-r--r-- | core/java/android/view/SurfaceControl.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index df07dcd1e016..e869d09adaa7 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -574,7 +574,8 @@ public class SurfaceControl { * @param maxLayer The highest (top-most Z order) surface layer to * include in the screenshot. * @return Returns a Bitmap containing the screen contents, or null - * if an error occurs. + * if an error occurs. Make sure to call Bitmap.recycle() as soon as + * possible, once its content is not needed anymore. */ public static Bitmap screenshot(int width, int height, int minLayer, int maxLayer) { // TODO: should take the display as a parameter @@ -586,6 +587,14 @@ public class SurfaceControl { /** * Like {@link SurfaceControl#screenshot(int, int, int, int)} but includes all * Surfaces in the screenshot. + * + * @param width The desired width of the returned bitmap; the raw + * screen will be scaled down to this size. + * @param height The desired height of the returned bitmap; the raw + * screen will be scaled down to this size. + * @return Returns a Bitmap containing the screen contents, or null + * if an error occurs. Make sure to call Bitmap.recycle() as soon as + * possible, once its content is not needed anymore. */ public static Bitmap screenshot(int width, int height) { // TODO: should take the display as a parameter |
