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

Re: gdk_draw_gray_image crashes



Hello,

Am Saturday, den 27. October 2001 09:52:17 schrieb Nikhil Hegde:
> Hello,
> 
>         I am trying to display a simple gray image using 
> gdk_draw_gray_image. It crashes on certain machines. The code and error
> are given below. 
> 
> -------------------------------------
> /* rgbbuf contains the gray information, and is of size Width*Height */
> 
> main()
> {
>   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
>   darea = gtk_drawing_area_new();
>   gtk_drawing_area_size (GTK_DRAWING_AREA (darea), Width, Height);
>   gtk_container_add (GTK_CONTAINER (window), darea);
>   gtk_signal_connect (GTK_OBJECT (darea), "expose-event",
>                         GTK_SIGNAL_FUNC (on_darea_expose), NULL);
>   gtk_widget_show_all (window);
> 
>   gtk_main();
> }
> 
> gboolean on_darea_expose (GtkWidget *widget,
>                    GdkEventExpose *event,
>                    gpointer user_data)
> {
>  gdk_draw_gray_image (widget->window, widget->style->white_gc, 
>    0, 0, Width, Height, GDK_RGB_DITHER_NONE, rgbbuf, Width);
> }
> 

You have to call gdk_rgb_init();

	MfG
	bmg

-- 
"Des is völlig wurscht, was heut beschlos- | M G Berberich
 sen wird: I bin sowieso dagegn!"          | berberic@fmi.uni-passau.de
(SPD-Stadtrat Kurt Schindler; Regensburg)  |

PGP signature



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