Languages

Menu
Sites
Language
How to Clean the Canvas(Evas) and re-draw some other things on Canvas(Native)

In my Native App I have a Canvas(Evas) Where I am able to Draw.
I can draw easily on the Canvas but can not clear the things that I have drawn on the Canvas.
I want to clear the Canvas after certain time and want to redraw some other things on the Canvas. how do I do that?
Please help.

Edited by: Mosharraf Hossain on 22 Jun, 2015

Responses

5 Replies
colin Rao

Hi, did you means, want to clean the canvas and re-draw some other things on canvas? Try below apis which is from the IDE help.

void  evas_obscured_rectangle_add (Evas *e, int x, int y, int w, int h)
  Adds an "obscured region" to an Evas canvas.
void  evas_obscured_clear (Evas *e)
  Removes all "obscured regions" from an Evas canvas.  
Mosharraf Hossain

I have tried with this but It is not working


Evas *evas = evas_object_evas_get((Evas_Object*)data);
 point = evas_object_rectangle_add(evas);
 evas_obscured_rectangle_add (evas, 0, 0, 320, 480);
 evas_object_pass_events_set(point, EINA_TRUE);
 evas_object_color_set(point, MOVE_COLOR);
 evas_object_resize(point, SMALL_POINT_RECT, SMALL_POINT_RECT);
 evas_object_move(point, p->x2, p->y2);
 evas_object_show(point);
 evas_obscured_clear (evas);

Alex Dem

Hi,
You could try to use evas_object_del (or evas_object_hide  if you want hide) to delete every Evas_Object.
There is also evas_render method which should: 'Forces rendering of the given canvas.'
Alexey.

Mosharraf Hossain

Thanks, now it is working.

Palitsyna

Hello,

just FYI, information about canvas functions can be found here:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__Evas__Canvas.html