### Constructor

# Cogl Bitmap new_from_buffer

#### Declaration [src]

    CoglBitmap*
    cogl_bitmap_new_from_buffer (
      CoglBuffer* buffer,
      CoglPixelFormat format,
      int width,
      int height,
      int rowstride,
      int offset
    )

#### Description [src]

Wraps some image data that has been uploaded into a `CoglBuffer` as a `CoglBitmap`. The data is not copied in this process.

This method is not directly available to language bindings.

#### Parameters

`buffer`

  Type: `CoglBuffer*`

  A `CoglBuffer` containing image data.

  The data is owned by the caller of the function.

`format`

  Type: `CoglPixelFormat`

  The `CoglPixelFormat` defining the format of the image data in the given `buffer`.

`width`

  Type: `int`

  The width of the image data in the given `buffer`.

`height`

  Type: `int`

  The height of the image data in the given `buffer`.

`rowstride`

  Type: `int`

  The rowstride in bytes of the image data in the given `buffer`.

`offset`

  Type: `int`

  The offset into the given `buffer` to the first pixel that should be considered part of the `CoglBitmap`.

#### Return value

Type: `CoglBitmap`

A `CoglBitmap` encapsulating the given `buffer`.

The caller of the function takes ownership of the data, and is responsible for freeing it.