using gdkpixbuf instead of gdkpixmap in the scribble program



Hello

I am trying to modify the scribble program in the tutorial to
incorporate GdkPixbuf rather than GdkPixmap. The function that creates
a GdkPixbuf is as follows:-

 pixbuf = gdk_pixbuf_new
(GDK_COLORSPACE_RGB,TRUE,5,widget->allocation.width,
widget->allocation.height);

The function to render the pixbuf on the widget is as follows :-

 gdk_draw_pixbuf(widget->window,widget->style->white_gc,pixbuf,200,200,200,200,widget->allocation.width,widget->allocation.height,GDK_RGB_DITHER_NORMAL,200,200);


and then I am passing the pixbuf to gdk_draw_rectangle as follows:-

 gdk_draw_rectangle (pixbuf,widget->style->white_gc,TRUE,0,
0,widget->allocation.width, widget->allocation.height);


Basically the thing that I am trying to do is use pixbuf rather than
pixmap as my backing pixbuf. However for some reason the pixbuf does
not show up on the widget and I am not able to draw on it.

Firstly can I use GdkPixbuf rather than GdkPixmap to to the scribble?
Also could somebody point out if I have not defined the functions
properly.

Thanks

Anurag


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