Share via


Bitmap.IsPremultiplied Property

Definition

Indicates whether pixels stored in this bitmaps are stored pre-multiplied.

public bool IsPremultiplied { [Android.Runtime.Register("isPremultiplied", "()Z", "")] get; }
[<get: Android.Runtime.Register("isPremultiplied", "()Z", "")>]
member this.IsPremultiplied : bool

Property Value

true if the underlying pixels have been pre-multiplied, false otherwise

Attributes

Remarks

Indicates whether pixels stored in this bitmaps are stored pre-multiplied. When a pixel is pre-multiplied, the RGB components have been multiplied by the alpha component. For instance, if the original color is a 50% translucent red (128, 255, 0, 0), the pre-multiplied form is (128, 128, 0, 0).

This method always returns false if #getConfig() is Bitmap.Config#RGB_565.

The return value is undefined if #getConfig() is Bitmap.Config#ALPHA_8.

This method only returns true if #hasAlpha() returns true. A bitmap with no alpha channel can be used both as a pre-multiplied and as a non pre-multiplied bitmap.

Only pre-multiplied bitmaps may be drawn by the view system or Canvas. If a non-pre-multiplied bitmap with an alpha channel is drawn to a Canvas, a RuntimeException will be thrown.

Java documentation for android.graphics.Bitmap.isPremultiplied().

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