Freigeben über


BitmapDrawable Constructors

Definition

Overloads

BitmapDrawable()
Obsolete.

Create an empty drawable, not dealing with density.

BitmapDrawable(Resources)
Obsolete.

Create an empty drawable, setting initial target density based on the display metrics of the resources.

BitmapDrawable(Bitmap)
Obsolete.

Create drawable from a bitmap, not dealing with density.

BitmapDrawable(Stream)
Obsolete.

Create a drawable by decoding a bitmap from the given input stream.

BitmapDrawable(String)
Obsolete.

Create a drawable by opening a given file path and decoding the bitmap.

BitmapDrawable(Resources, Bitmap)

Create drawable from a bitmap, setting initial target density based on the display metrics of the resources.

BitmapDrawable(Resources, Stream)

Create a drawable by decoding a bitmap from the given input stream.

BitmapDrawable(Resources, String)

Create a drawable by opening a given file path and decoding the bitmap.

BitmapDrawable(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

BitmapDrawable()

Caution

deprecated

Create an empty drawable, not dealing with density.

[Android.Runtime.Register(".ctor", "()V", "")]
[System.Obsolete("deprecated")]
public BitmapDrawable ();
Attributes

Remarks

Create an empty drawable, not dealing with density.

This member is deprecated. Use #BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap) instead to specify a bitmap to draw with and ensure the correct density is set.

Java documentation for android.graphics.drawable.BitmapDrawable.BitmapDrawable().

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

BitmapDrawable(Resources)

Caution

deprecated

Create an empty drawable, setting initial target density based on the display metrics of the resources.

[Android.Runtime.Register(".ctor", "(Landroid/content/res/Resources;)V", "")]
[System.Obsolete("deprecated")]
public BitmapDrawable (Android.Content.Res.Resources? res);
[<Android.Runtime.Register(".ctor", "(Landroid/content/res/Resources;)V", "")>]
[<System.Obsolete("deprecated")>]
new Android.Graphics.Drawables.BitmapDrawable : Android.Content.Res.Resources -> Android.Graphics.Drawables.BitmapDrawable

Parameters

res
Resources
Attributes

Remarks

Create an empty drawable, setting initial target density based on the display metrics of the resources.

This member is deprecated. Use #BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap) instead to specify a bitmap to draw with.

Java documentation for android.graphics.drawable.BitmapDrawable.BitmapDrawable(android.content.res.Resources).

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

BitmapDrawable(Bitmap)

Caution

deprecated

Create drawable from a bitmap, not dealing with density.

[Android.Runtime.Register(".ctor", "(Landroid/graphics/Bitmap;)V", "")]
[System.Obsolete("deprecated")]
public BitmapDrawable (Android.Graphics.Bitmap? bitmap);
[<Android.Runtime.Register(".ctor", "(Landroid/graphics/Bitmap;)V", "")>]
[<System.Obsolete("deprecated")>]
new Android.Graphics.Drawables.BitmapDrawable : Android.Graphics.Bitmap -> Android.Graphics.Drawables.BitmapDrawable

Parameters

bitmap
Bitmap
Attributes

Remarks

Create drawable from a bitmap, not dealing with density.

This member is deprecated. Use #BitmapDrawable(Resources, Bitmap) to ensure that the drawable has correctly set its target density.

Java documentation for android.graphics.drawable.BitmapDrawable.BitmapDrawable(android.graphics.Bitmap).

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

BitmapDrawable(Stream)

Caution

deprecated

Create a drawable by decoding a bitmap from the given input stream.

[Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;)V", "")]
[System.Obsolete("deprecated")]
public BitmapDrawable (System.IO.Stream? is);
[<Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;)V", "")>]
[<System.Obsolete("deprecated")>]
new Android.Graphics.Drawables.BitmapDrawable : System.IO.Stream -> Android.Graphics.Drawables.BitmapDrawable

Parameters

is
Stream
Attributes

Remarks

Create a drawable by decoding a bitmap from the given input stream.

This member is deprecated. Use #BitmapDrawable(Resources, java.io.InputStream) to ensure that the drawable has correctly set its target density.

Java documentation for android.graphics.drawable.BitmapDrawable.BitmapDrawable(java.io.InputStream).

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

BitmapDrawable(String)

Caution

deprecated

Create a drawable by opening a given file path and decoding the bitmap.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")]
[System.Obsolete("deprecated")]
public BitmapDrawable (string? filepath);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")>]
[<System.Obsolete("deprecated")>]
new Android.Graphics.Drawables.BitmapDrawable : string -> Android.Graphics.Drawables.BitmapDrawable

Parameters

filepath
String
Attributes

Remarks

Create a drawable by opening a given file path and decoding the bitmap.

This member is deprecated. Use #BitmapDrawable(Resources, String) to ensure that the drawable has correctly set its target density.

Java documentation for android.graphics.drawable.BitmapDrawable.BitmapDrawable(java.lang.String).

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

BitmapDrawable(Resources, Bitmap)

Create drawable from a bitmap, setting initial target density based on the display metrics of the resources.

[Android.Runtime.Register(".ctor", "(Landroid/content/res/Resources;Landroid/graphics/Bitmap;)V", "")]
public BitmapDrawable (Android.Content.Res.Resources? res, Android.Graphics.Bitmap? bitmap);
[<Android.Runtime.Register(".ctor", "(Landroid/content/res/Resources;Landroid/graphics/Bitmap;)V", "")>]
new Android.Graphics.Drawables.BitmapDrawable : Android.Content.Res.Resources * Android.Graphics.Bitmap -> Android.Graphics.Drawables.BitmapDrawable

Parameters

res
Resources
bitmap
Bitmap
Attributes

Remarks

Create drawable from a bitmap, setting initial target density based on the display metrics of the resources.

Java documentation for android.graphics.drawable.BitmapDrawable.BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap).

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

BitmapDrawable(Resources, Stream)

Create a drawable by decoding a bitmap from the given input stream.

[Android.Runtime.Register(".ctor", "(Landroid/content/res/Resources;Ljava/io/InputStream;)V", "")]
public BitmapDrawable (Android.Content.Res.Resources? res, System.IO.Stream? is);
[<Android.Runtime.Register(".ctor", "(Landroid/content/res/Resources;Ljava/io/InputStream;)V", "")>]
new Android.Graphics.Drawables.BitmapDrawable : Android.Content.Res.Resources * System.IO.Stream -> Android.Graphics.Drawables.BitmapDrawable

Parameters

res
Resources
is
Stream
Attributes

Remarks

Create a drawable by decoding a bitmap from the given input stream.

Java documentation for android.graphics.drawable.BitmapDrawable.BitmapDrawable(android.content.res.Resources, java.io.InputStream).

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

BitmapDrawable(Resources, String)

Create a drawable by opening a given file path and decoding the bitmap.

[Android.Runtime.Register(".ctor", "(Landroid/content/res/Resources;Ljava/lang/String;)V", "")]
public BitmapDrawable (Android.Content.Res.Resources? res, string? filepath);
[<Android.Runtime.Register(".ctor", "(Landroid/content/res/Resources;Ljava/lang/String;)V", "")>]
new Android.Graphics.Drawables.BitmapDrawable : Android.Content.Res.Resources * string -> Android.Graphics.Drawables.BitmapDrawable

Parameters

res
Resources
filepath
String
Attributes

Remarks

Create a drawable by opening a given file path and decoding the bitmap.

Java documentation for android.graphics.drawable.BitmapDrawable.BitmapDrawable(android.content.res.Resources, java.lang.String).

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

BitmapDrawable(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected BitmapDrawable (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Graphics.Drawables.BitmapDrawable : nativeint * Android.Runtime.JniHandleOwnership -> Android.Graphics.Drawables.BitmapDrawable

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

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