Hi ,

I am using clutter 1.2.12 and notice a strange white broder around an icon 
image when I load it thru GdkPixbuf containing the rgb pixel data corresponding 
to the icon. I remeber the same code used to work for 1.0.10. Is it a known 
issue for 1.2.12? This mostly happen when icon is not rectangular. Seems like 
base color of the surface of the texture is visible and icon is not extended 
properly.

        const GdkPixbuf *iconbuf ; // cotains rgb pixels for the image

            GdkPixbufFormat *format = 
gdk_pixbuf_get_file_info("/home/nirmalya/icon .png", NULL, NULL);
            if (format) {
                iconbuf = gdk_pixbuf_new_from_file("/home/nirmalya/icon. png", 
NULL);
            }

    if (iconbuf) {
        int icon_width = gdk_pixbuf_get_width(iconbuf);
        int icon_height = gdk_pixbuf_get_height(iconbuf) ;
        guchar *pixels = gdk_pixbuf_get_pixels(iconbuf) ;
        gboolean has_alpha = gdk_pixbuf_get_has_alpha( iconbuf);
        int bpp = (has_alpha)? 4:3;
        int rowstrides = gdk_pixbuf_get_rowstride( iconbuf);
        clutter_texture_set_from_rgb_ data(CLUTTER_TEXTURE(actor) , pixels, 
has_alpha, icon_width, icon_height, rowstrides, bpp, CLUTTER_TEXTURE_NONE , 
NULL);
        clutter_actor_set_size(actor, 72, 72);
}

However if I set the texture directly from file it works fine:

clutter_texture_set_from_file(CLUTTER_TEXTURE(actor), 
"/home/nirmalya/icon.png");      

Any help is really appreciated.

Thanks!
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to