mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
add lv_canvas_get_img()
This commit is contained in:
parent
21eab152a6
commit
9347165a5a
@ -171,6 +171,18 @@ lv_color_t lv_canvas_get_px(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y)
|
|||||||
return lv_img_buf_get_px(&ext->dsc, x, y);
|
return lv_img_buf_get_px(&ext->dsc, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the image of the canvas as a pointer to an `lv_img_dsc_t` variable.
|
||||||
|
* @param canvas pointer to a canvas object
|
||||||
|
* @return pointer to the image descriptor.
|
||||||
|
*/
|
||||||
|
lv_img_dsc_t * lv_canvas_get_img(lv_obj_t * canvas)
|
||||||
|
{
|
||||||
|
lv_canvas_ext_t * ext = lv_obj_get_ext_attr(canvas);
|
||||||
|
|
||||||
|
return &ext->img;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get style of a canvas.
|
* Get style of a canvas.
|
||||||
* @param canvas pointer to canvas object
|
* @param canvas pointer to canvas object
|
||||||
|
@ -111,8 +111,8 @@ lv_color_t lv_canvas_get_px(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y);
|
|||||||
* Get the image of the canvas as a pointer to an `lv_img_dsc_t` variable.
|
* Get the image of the canvas as a pointer to an `lv_img_dsc_t` variable.
|
||||||
* @param canvas pointer to a canvas object
|
* @param canvas pointer to a canvas object
|
||||||
* @return pointer to the image descriptor.
|
* @return pointer to the image descriptor.
|
||||||
lv_img_dsc_t * lv_canvas_get_img(lv_obj_t * canvas);
|
|
||||||
*/
|
*/
|
||||||
|
lv_img_dsc_t * lv_canvas_get_img(lv_obj_t * canvas);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get style of a canvas.
|
* Get style of a canvas.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user