Partager via


Canvas Constructors

Definition

Overloads

Canvas()

Construct an empty raster canvas.

Canvas(Bitmap)

Construct a canvas with the specified bitmap to draw into.

Canvas(IGL)
Obsolete.
Canvas(IntPtr, JniHandleOwnership)

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

Canvas()

Construct an empty raster canvas.

[Android.Runtime.Register(".ctor", "()V", "")]
public Canvas ();
Attributes

Remarks

Construct an empty raster canvas. Use setBitmap() to specify a bitmap to draw into. The initial target density is Bitmap#DENSITY_NONE; this will typically be replaced when a target bitmap is set for the canvas.

Java documentation for android.graphics.Canvas.Canvas().

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

Canvas(Bitmap)

Construct a canvas with the specified bitmap to draw into.

[Android.Runtime.Register(".ctor", "(Landroid/graphics/Bitmap;)V", "")]
public Canvas (Android.Graphics.Bitmap bitmap);
[<Android.Runtime.Register(".ctor", "(Landroid/graphics/Bitmap;)V", "")>]
new Android.Graphics.Canvas : Android.Graphics.Bitmap -> Android.Graphics.Canvas

Parameters

bitmap
Bitmap

Specifies a mutable bitmap for the canvas to draw into.

Attributes

Remarks

Construct a canvas with the specified bitmap to draw into. The bitmap must be mutable.

The initial target density of the canvas is the same as the given bitmap's density.

Java documentation for android.graphics.Canvas.Canvas(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

Canvas(IGL)

Caution

This method does not exist in API-11+.

[System.Obsolete("This method does not exist in API-11+.", true)]
public Canvas (Javax.Microedition.Khronos.Opengles.IGL gl);
[<System.Obsolete("This method does not exist in API-11+.", true)>]
new Android.Graphics.Canvas : Javax.Microedition.Khronos.Opengles.IGL -> Android.Graphics.Canvas

Parameters

gl
IGL
Attributes

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

Canvas(IntPtr, JniHandleOwnership)

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

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

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