From 544333b39ec612e0e3426d3ef90b21761ea0d751 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Mon, 5 Aug 2013 14:37:12 -0700 Subject: [PATCH] Better explain outWidth/Height use with inJustDecodeBounds Change-Id: I81d2d63a1dd0792ca11a157b30152496b16e4c8d --- .../java/android/graphics/BitmapFactory.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java index a4124bfc84812..d45cc4a1e224f 100644 --- a/graphics/java/android/graphics/BitmapFactory.java +++ b/graphics/java/android/graphics/BitmapFactory.java @@ -251,17 +251,22 @@ public class BitmapFactory { public boolean inPreferQualityOverSpeed; /** - * The resulting width of the bitmap, set independent of the state of - * inJustDecodeBounds. However, if there is an error trying to decode, - * outWidth will be set to -1. + * The resulting width of the bitmap. If {@link #inJustDecodeBounds} is + * set to false, this will be width of the output bitmap after any + * scaling is applied. If true, it will be the width of the input image + * without any accounting for scaling. + * + *

outWidth will be set to -1 if there is an error trying to decode.

*/ - public int outWidth; /** - * The resulting height of the bitmap, set independent of the state of - * inJustDecodeBounds. However, if there is an error trying to decode, - * outHeight will be set to -1. + * The resulting height of the bitmap. If {@link #inJustDecodeBounds} is + * set to false, this will be height of the output bitmap after any + * scaling is applied. If true, it will be the height of the input image + * without any accounting for scaling. + * + *

outHeight will be set to -1 if there is an error trying to decode.

*/ public int outHeight;