docs(calvas): fix that LV_CANVAS_BUF_SIZE_ return byte count and not pixel count

fixes #3734
This commit is contained in:
Gabor Kiss-Vamosi
2022-10-11 20:17:11 +02:00
parent 5971894a9b
commit 853163f615
3 changed files with 4 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ The Canvas needs a buffer in which stores the drawn image.
To assign a buffer to a Canvas, use `lv_canvas_set_buffer(canvas, buffer, width, height, LV_IMG_CF_...)`.
Where `buffer` is a static buffer (not just a local variable) to hold the image of the canvas.
For example,
`static lv_color_t buffer[LV_CANVAS_BUF_SIZE_TRUE_COLOR(width, height)]`.
`static uint8_t buffer[LV_CANVAS_BUF_SIZE_TRUE_COLOR(width, height)]`.
`LV_CANVAS_BUF_SIZE_...` macros help to determine the size of the buffer with different color formats.
The canvas supports all the built-in color formats like `LV_IMG_CF_TRUE_COLOR` or `LV_IMG_CF_INDEXED_2BIT`.