set_from_buffer_at_size


Description:

public bool set_from_buffer_at_size (owned uint8[] buffer, DestroyNotify? buffer_free_func, int width, int height) throws Error

Set the image data from unencoded image data, stored in memory, and scales it while loading.

In case of failure, false is returned and error is set. It is expected that buffer will remain accessible for the duration of the load. Once it is finished with, buffer_free_func will be called. The aspect ratio will always be maintained.

Parameters:

this

An Image

buffer

A buffer pointing to encoded image data

buffer_free_func

A function to free buffer, or null

width

Width to scale the image to, or -1

height

Height to scale the image to, or -1

buffer_size

The size of buffer, in bytes

Returns:

true if the image was successfully updated




2022 vala-language.org