次の方法で共有


BitmapFactory.Options.InScaled Property

Definition

When this flag is set, if #inDensity and #inTargetDensity are not 0, the bitmap will be scaled to match #inTargetDensity when loaded, rather than relying on the graphics system scaling it each time it is drawn to a Canvas.

[Android.Runtime.Register("inScaled")]
public bool InScaled { get; set; }
[<Android.Runtime.Register("inScaled")>]
member this.InScaled : bool with get, set

Property Value

Attributes

Remarks

When this flag is set, if #inDensity and #inTargetDensity are not 0, the bitmap will be scaled to match #inTargetDensity when loaded, rather than relying on the graphics system scaling it each time it is drawn to a Canvas.

BitmapRegionDecoder ignores this flag, and will not scale output based on density. (though #inSampleSize is supported)

This flag is turned on by default and should be turned off if you need a non-scaled version of the bitmap. Nine-patch bitmaps ignore this flag and are always scaled.

If #inPremultiplied is set to false, and the image has alpha, setting this flag to true may result in incorrect colors.

Java documentation for android.graphics.BitmapFactory.Options.inScaled.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to