Skip to main content

lv_canvas_set_buffer

Function lv_canvas_set_buffer 

Source
pub unsafe extern "C" fn lv_canvas_set_buffer(
    obj: *mut lv_obj_t,
    buf: *mut c_void,
    w: i32,
    h: i32,
    cf: lv_color_format_t,
)
Expand description

Set a buffer for the canvas.

Use lv_canvas_set_draw_buf() instead if you need to set a buffer with alignment requirement.

@param obj pointer to a canvas object @param buf buffer where content of canvas will be. The required size is (lv_image_color_format_get_px_size(cf) * w) / 8 * h) It can be allocated with lv_malloc() or it can be statically allocated array (e.g. static lv_color_t buf[100*50]) or it can be an address in RAM or external SRAM @param w width of canvas @param h height of canvas @param cf color format. LV_COLOR_FORMAT...