Aracılığıyla paylaş


Bitmap.ExtractAlpha Method

Definition

Overloads

ExtractAlpha()

Returns a new bitmap that captures the alpha values of the original.

ExtractAlpha(Paint, Int32[])

Returns a new bitmap that captures the alpha values of the original.

ExtractAlpha()

Returns a new bitmap that captures the alpha values of the original.

[Android.Runtime.Register("extractAlpha", "()Landroid/graphics/Bitmap;", "")]
public Android.Graphics.Bitmap ExtractAlpha ();
[<Android.Runtime.Register("extractAlpha", "()Landroid/graphics/Bitmap;", "")>]
member this.ExtractAlpha : unit -> Android.Graphics.Bitmap

Returns

new bitmap containing the alpha channel of the original bitmap.

Attributes

Remarks

Returns a new bitmap that captures the alpha values of the original. This may be drawn with Canvas.drawBitmap(), where the color(s) will be taken from the paint that is passed to the draw call.

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

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

ExtractAlpha(Paint, Int32[])

Returns a new bitmap that captures the alpha values of the original.

[Android.Runtime.Register("extractAlpha", "(Landroid/graphics/Paint;[I)Landroid/graphics/Bitmap;", "")]
public Android.Graphics.Bitmap ExtractAlpha (Android.Graphics.Paint? paint, int[]? offsetXY);
[<Android.Runtime.Register("extractAlpha", "(Landroid/graphics/Paint;[I)Landroid/graphics/Bitmap;", "")>]
member this.ExtractAlpha : Android.Graphics.Paint * int[] -> Android.Graphics.Bitmap

Parameters

paint
Paint

Optional paint used to modify the alpha values in the resulting bitmap. Pass null for default behavior.

offsetXY
Int32[]

Optional array that returns the X (index 0) and Y (index 1) offset needed to position the returned bitmap so that it visually lines up with the original.

Returns

new bitmap containing the (optionally modified by paint) alpha channel of the original bitmap. This may be drawn with Canvas.drawBitmap(), where the color(s) will be taken from the paint that is passed to the draw call.

Attributes

Remarks

Returns a new bitmap that captures the alpha values of the original. These values may be affected by the optional Paint parameter, which can contain its own alpha, and may also contain a MaskFilter which could change the actual dimensions of the resulting bitmap (e.g. a blur maskfilter might enlarge the resulting bitmap). If offsetXY is not null, it returns the amount to offset the returned bitmap so that it will logically align with the original. For example, if the paint contains a blur of radius 2, then offsetXY[] would contains -2, -2, so that drawing the alpha bitmap offset by (-2, -2) and then drawing the original would result in the blur visually aligning with the original.

The initial density of the returned bitmap is the same as the original's.

Java documentation for android.graphics.Bitmap.extractAlpha(android.graphics.Paint, int[]).

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