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
#include <Evas.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <stdio.h>
#include <stdlib.h>
static void
on_delete(void *data, Evas *e, Evas_Object *o, void *einfo)
{
ecore_main_loop_quit();
}
int
main(int argc, char *argv[])
{
Ecore_Evas *ee;
Evas *e;
Evas_Object *im;
const char *file;
int load_err;
if (argc < 2)
{
fputs("ERROR: missing image filename.\n", stderr);
return -1;
}
file = argv[1];
evas_init();
ecore_init();
ecore_evas_init();
ee = ecore_evas_new(NULL, 0, 0, 320, 240, NULL);
if (!ee) goto end;
e = ecore_evas_get(ee);
im = evas_object_image_filled_add(e);
if (!im) goto end;
evas_object_image_file_set(im, file, NULL);
load_err = evas_object_image_load_error_get(im);
if (load_err != EVAS_LOAD_ERROR_NONE)
{
fprintf(stderr, "ERROR: could not load image \"%s\": %d\n",
file, load_err);
goto end;
}
ecore_evas_object_associate(ee, im, 0);
evas_object_event_callback_add(im, EVAS_CALLBACK_DEL, on_delete, NULL);
evas_object_resize(im, 320, 240);
evas_object_show(im);
ecore_main_loop_begin();
end:
ecore_evas_shutdown();
ecore_shutdown();
evas_shutdown();
return 0;
}
------------------------------------------------------------------------------
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