[Glade-users] images in gnome canvas


I am trying to load an image and then manipulate it with the use of the
gnome canvas but unfortunately i've found it is making my entire program
quite unresponsive and slow. 

I load the pixbuf form a file and then draw it on the canvas in the main

map = gdk_pixbuf_new_from_file_at_size ("../pixmaps/map_brisbane.png", 900,
900, NULL);
canvMap = gnome_canvas_item_new(gnome_canvas_root(gnomecanvas),
                                "x", (double)300, 
                                "y", (double)300,
                                "width", (double)600,  

I use an idle_callback function to move the image around and i simply change
the pixels per unit to zoom the entire canvas;

        double xvel; //x velocity
        double yvel; //y velocity
        double vel= gtk_range_get_value(lookup_widget(GTK_WIDGET(app1),

        xvel = vel*sin(home_head*C_DEG2RAD);
        yvel = vel*cos(home_head*C_DEG2RAD);

The problem I am having is when the image is enlarged, when I decrease the
size it seems to function normaly again. Also, without the image the program
functions normally so i'm gussing it has something to do with rendering the
pixbuf to the canvas but i'm not too sure what explicitly would be causing
this problem weather it'd be the image itself or an inherent problem with
the gnome canvas or simply me doing something completely wrong. any help
would be greatly appreciated.


View this message in context: http://www.nabble.com/images-in-gnome-canvas-tp14572023p14572023.html
Sent from the Gnome - Glade - User mailing list archive at Nabble.com.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]