1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
gboolean configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer data)
{
T_callback *f=(T_callback *)data;
(void) event;
(void) widget;
//redimensionne le pixbuf et l'affiche dans l'image
gtk_image_set_from_pixbuf_with_scaling(GTK_IMAGE(f->image),f->pixbuf,f->image->allocation.width,f->image->allocation.height);
printf("oui\n\n");
return TRUE;
}
... f->pixbuf=gdk_pixbuf_new(GDK_COLORSPACE_RGB,FALSE,8,LARGEUR,HAUTEUR);
f->image=gtk_image_new_from_pixbuf(f->pixbuf);
gtk_image_set_from_pixbuf_with_scaling(GTK_IMAGE(f->image),f->pixbuf,f->image->allocation.width,f->image->allocation.height);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll),GTK_WIDGET(f->image));
gdk_pixbuf_fill(f->pixbuf,0xffffffff); /* On initialise la couleur à blanc */
gtk_widget_add_events(f->image,GDK_CONFIGURE);
g_signal_connect(G_OBJECT(f->image),"configure-event",G_CALLBACK(configure_event),f);
... |
Partager