From: Victor K. <v_k...@ya...> - 2005-11-16 14:51:06
|
Hi, I use a fonction to orientate an image that use imlib_image_orientate(). The rotation works well but the flip doesn't. If I flip, the image itself isn't flipped until I resize it. Here's a little piece of the code: /* rotate or flip an image */ static void retina_img_orientate(Retina *retina, int orientation) { Imlib_Image *im; int w, h; if (evas_object_image_data_get(retina->image, 1)) { if ((im = imlib_create_image_using_copied_data(retina->img.orig_w, retina->img.orig_h, evas_object_image_data_get(retina->image, 1)))) { imlib_context_set_image(im); imlib_image_orientate(orientation); w = imlib_image_get_width(); h = imlib_image_get_height(); retina->img.orig_w = w; retina->img.orig_h = h; retina->img.zoom_w = retina->img.z_factor * retina->img.orig_w; retina->img.zoom_h = retina->img.z_factor * retina->img.orig_h; evas_object_image_size_set(retina->image, w, h); evas_object_image_data_copy_set(retina->image, imlib_image_get_data()); retina_img_resize(retina, retina->img.zoom_w, retina->img.zoom_h); retina_win_resize_cb(retina->ee); imlib_free_image(); } } } /* rotate clockwise */ void retina_img_rotate_right(Retina *retina) { retina_img_orientate(retina, 1); } /* rotate counter-clockwise */ void retina_img_rotate_left(Retina *retina) { retina_img_orientate(retina, 3); } /* horizontal flip */ void retina_img_flip_h(Retina *retina) { retina_img_orientate(retina, 4); } /* vertical flip */ void retina_img_flip_v(Retina *retina) { retina_img_orientate(retina, 6); } Have I done something wrong? Or is it an imlib2 problem? Victor ___________________________________________________________________________ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com |