Android Guides | Samples

Android.Graphics.Picture Class

A Picture records drawing calls (via the canvas returned by beginRecording) and can then play them back into Canvas (via Picture.Draw(Canvas) or Canvas.DrawPicture(Picture)).

See Also: Picture

Syntax

[Android.Runtime.Register("android/graphics/Picture", DoNotGenerateAcw=true)]
public class Picture : Object

Remarks

A Picture records drawing calls (via the canvas returned by beginRecording) and can then play them back into Canvas (via Picture.Draw(Canvas) or Canvas.DrawPicture(Picture)).For most content (e.g. text, lines, rectangles), drawing a sequence from a picture can be faster than the equivalent API calls, since the picture performs its playback without incurring any method-call overhead.

[Android Documentation]

Requirements

Namespace: Android.Graphics
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Graphics.Picture are listed below.

See Also: Object

Public Constructors

Creates an empty picture that is ready to record.
Create a picture by making a copy of what has already been recorded in src.

Protected Constructors

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

Public Properties

[read-only]
HeightInt32. Get the height of the picture as passed to beginRecording.
[read-only]
WidthInt32. Get the width of the picture as passed to beginRecording.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

BeginRecording(Int32, Int32) : Canvas
To record a picture, call beginRecording() and then draw into the Canvas that is returned.
static
CreateFromStream(Stream) : Picture
Create a new picture (already recorded) from the data in the stream.
static
CreateFromStreamAsync(Stream) : System.Threading.Tasks.Task<Picture>
Draw(Canvas)
Draw this picture on the canvas.
EndRecording()
Call endRecording when the picture is built.
WriteToStream(Stream)
Write the picture contents to a stream.
WriteToStreamAsync(Stream) : Task