Re: Help with GdkPIxbuf and GtkImage...
- From: heavenscape <masonduan1 sina com>
- To: gtk-list gnome org
- Subject: Re: Help with GdkPIxbuf and GtkImage...
- Date: Thu, 1 Jun 2006 22:41:35 -0700 (PDT)
Maybe I am having the same question as you do. I am trying to display a 24bit
image with size 2048X2048 pixels, and following is my code: 
//create a GdkPixbuf
	GdkPixbuf* pb = gdk_pixbuf_new_from_data( pDisplayBuf,   // data buffer
		GDK_COLORSPACE_RGB,   //COLORSPACE
		FALSE,  // has_alpha,
		8,          //      int bits_per_sample,
          	2048,  //      int width,
           	2048,  //      int height,
               	2048*3,  // sizeX*3;  //int rowstride,
              	NULL,    //GdkPixbufDestroyNotify destroy_fn,
            	NULL     //gpointer destroy_fn_data);
		);
//display img
	GtkWidget* img = lookup_widget(MainWnd, "image1");
	gtk_image_set_from_pixbuf(GTK_IMAGE(img),    //GtkImage *image,
        	pb//     GdkPixbuf *pixbuf
		);
the results i got is that: the image did appear, but the sizes are shrinked
as 684 X 684 , and  there are THREE same images tile in the viewport, the
first and last ones are clipped.
Can anyone tell me how to fix this? thanks!!
--
View this message in context: http://www.nabble.com/Help-with-GdkPIxbuf-and-GtkImage...-t800118.html#a4674575
Sent from the Gtk+ - General forum at Nabble.com.
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]