From c2e3e9d494f6b46f6f8ad65e34ad131044d08b91 Mon Sep 17 00:00:00 2001 From: Ali Rostami <9710249+ali-rostami@users.noreply.github.com> Date: Mon, 4 Mar 2019 12:47:03 +0330 Subject: [PATCH] add offset member to lv_img_ext_t --- lv_objx/lv_img.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lv_objx/lv_img.h b/lv_objx/lv_img.h index 8ee861679..59f42af46 100644 --- a/lv_objx/lv_img.h +++ b/lv_objx/lv_img.h @@ -40,7 +40,7 @@ typedef struct /*No inherited ext. because inherited from the base object*/ /*Ext. of ancestor*/ /*New data for this type */ const void * src; /*Image source: Pointer to an array or a file or a symbol*/ - + lv_point_t offset; lv_coord_t w; /*Width of the image (Handled by the library)*/ lv_coord_t h; /*Height of the image (Handled by the library)*/ #if USE_LV_MULTI_LANG @@ -103,6 +103,14 @@ static inline void lv_img_set_file(lv_obj_t * img, const char * fn) */ void lv_img_set_auto_size(lv_obj_t * img, bool autosize_en); + /** + * Set an offset for the source of an image. + * so the image will be displayed from this new origin. + * @param img pointer to an image + * @param en true: auto size enable, false: auto size disable + */ +void lv_img_set_offset(lv_obj_t *img, lv_point_t offset); + /** * Set the style of an image * @param img pointer to an image object