Bitmap.for_data


Description:

public Bitmap.for_data (Context context, int width, int height, PixelFormat format, int rowstride, uint8 data)

Creates a bitmap using some existing data.

The data is not copied so the application must keep the buffer alive for the lifetime of the Bitmap. This can be used for example with read_pixels_into_bitmap to read data directly into an application buffer with the specified rowstride.

Parameters:

context

A Context

width

The width of the bitmap.

height

The height of the bitmap.

format

The format of the pixel data.

rowstride

The rowstride of the bitmap (the number of bytes from the start of one row of the bitmap to the next).

data

A pointer to the data. The bitmap will take ownership of this data.

Returns:

A new Bitmap.