语言

Menu
Sites
Language
Merge text and image as a single image

How to merge background image and text written on it, and user can download as a single(merged) image?

Here is my code which contains image in bg and text on it. Iwant to merge both and make one image which user can download.

char buf[PATH_MAX];
const char *path = app_get_resource_path();
sprintf(buf,"%simg.jpg",path);

ad->bg=elm_bg_add(table);
elm_bg_file_set(ad->bg,buf,NULL);
elm_bg_option_set(ad->bg,ELM_BG_OPTION_SCALE);
my_table_pack(table,ad->bg,0,0,19,18);

Evas_Object *bg2=elm_bg_add(table);
evas_object_color_set(bg2,0,0,0,130);
elm_bg_option_set(bg2,ELM_BG_OPTION_SCALE);
my_table_pack(table,bg2,0,0,19,18);

ad->label = elm_entry_add(bg2);
elm_entry_editable_set(ad->label,EINA_FALSE);
elm_entry_text_set(ad->label,"hello world");
my_table_pack(table,ad->label,2,6,16,8);

 

编辑者为: bhoomika rathod 16 10月, 2017

响应

1 回复
Shaswati Saha

So far I know, you can save an image of current window and save it into an evas object, but you can't save the object into an image file. Will that do your work? If yes, you may follow the snippet below:

Evas_Object *win = elm_win_add(NULL, "main", ELM_WIN_BASIC);

evas_object_resize(win, 200, 200);

evas_object_show(win);

Evas *e = evas_object_evas_get(win);

Evas_Object *img = evas_object_image_filled_add(e);

evas_object_resize(img, 200, 200);

evas_object_show(img);