lv_canvas_set_buffer() function
Set a buffer for the canvas. Use lv_canvas_set_draw_buf() instead if you need to set a buffer with alignment requirement.
Arguments
obj
pointer to a canvas object
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
cf
color format. `LV_COLOR_FORMAT...`
lv_canvas_set_buffer() is called by 1 function and calls 5 functions:
![]()
lv_canvas_set_buffer()
lv_canvas_set_buffer() reads 1 variable and writes 1 variable:
![]()
lv_canvas_set_buffer()