Bitmap.CopyPixelsToBuffer(Buffer) Method

Definition

Copy the bitmap's pixels into the specified buffer (allocated by the caller).

[Android.Runtime.Register("copyPixelsToBuffer", "(Ljava/nio/Buffer;)V", "")]
public void CopyPixelsToBuffer (Java.Nio.Buffer dst);
[<Android.Runtime.Register("copyPixelsToBuffer", "(Ljava/nio/Buffer;)V", "")>]
member this.CopyPixelsToBuffer : Java.Nio.Buffer -> unit

Parameters

dst
Buffer
Attributes

Remarks

Copy the bitmap's pixels into the specified buffer (allocated by the caller). An exception is thrown if the buffer is not large enough to hold all of the pixels (taking into account the number of bytes per pixel) or if the Buffer subclass is not one of the support types (ByteBuffer, ShortBuffer, IntBuffer).

The content of the bitmap is copied into the buffer as-is. This means that if this bitmap stores its pixels pre-multiplied (see #isPremultiplied(), the values in the buffer will also be pre-multiplied. The pixels remain in the color space of the bitmap.

After this method returns, the current position of the buffer is updated: the position is incremented by the number of elements written in the buffer.

Java documentation for android.graphics.Bitmap.copyPixelsToBuffer(java.nio.Buffer).

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