Thanks for your answer Gustavo !
I've tried the new evas_object_image_filled_add() and it works well I
think... for someone who want to fill the complete evas canvas with an image
and resize it when one or the other is resized.
What I wanted to do was to fill the part:swallow with my image in order to
have its top left corner at rel1 and the bottom right corner at rel2.
I think getting the part:swallow as an object and then querying its min size
didn't do what I expected but I've found a better way to do that :
edje_object_part_geometry_get()
So here is my code now :

   - const Evas_Object *swallow = NULL;
   - swallow = edje_object_part_object_get(my_edje, "place_for_image");
   - edje_object_size_min_get(swallow, &w, &h);
   - evas_object_image_fill_set(image, 0, 0, w, h);
   + Evas_Coord x, y;
   + edje_object_part_geometry_get(my_edje, "place_for_image", &x, &y ,&w,
&h);
   + printf("x:%d, y:%d, w:%d, h:%d", x, y, w, h);
   + evas_object_image_fill_set(image, 0, 0, w, h);
   + edje_object_part_swallow(my_edje, "place_for_image", image);

With that call I can even remove the min size of the swallow part in the edc
because it seams to be calculated..
Don't know if the description of my problem is clearer now or if I really
understand what you proposed :p
But now it works so thank you Gustavo !

2008/12/12 Gustavo Sverzut Barbieri <[email protected]>

> On Fri, Dec 12, 2008 at 6:07 PM, Vincent Pomageot
> <[email protected]> wrote:
> > Hi devs !
> >
> > I'm begining to play with edje and have difficulties to swallow an
> > evas_object_image into an edje part swallow.
> > I'm under the impression I have to call evas_object_image_fill_set()
> before
> > swalloing the image into the edje but I must do something wrong because
> > either my image isn't scaled to the swallowing part or I get something
> gray.
>
> yes, this is correct, Edje will not even know the swallowed part is an
> image, so it will not change fill property.
>
> if you want to keep it "scaled" (fill == (0, 0, w, h)), then you
> should add an event listener for EVAS_CALLBACK_RESIZE and apply fill
> again.
>
> For Python I added FilledImage that will do that for you for a long
> time, just noticed that C still miss such a helper! So I just added to
> SVN (r38120):
>
>       Evas_Object  *evas_object_image_filled_add(Evas *e);
>       void  evas_object_image_filled_set(Evas_Object *obj, Evas_Bool
> setting);
>       Evas_Bool evas_object_image_filled_get(const Evas_Object *obj);
>
> See attached file for usage example.
>
> --
> Gustavo Sverzut Barbieri
> http://profusion.mobi embedded systems
> --------------------------------------
> MSN: [email protected]
> Skype: gsbarbieri
> Mobile: +55 (19) 9225-2202
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to