Skip to content

Instantly share code, notes, and snippets.

@bert
Created December 19, 2009 17:02
Show Gist options
  • Select an option

  • Save bert/260147 to your computer and use it in GitHub Desktop.

Select an option

Save bert/260147 to your computer and use it in GitHub Desktop.
Grey drawing area snippet
width = DrawingArea->allocation.width;
height = DrawingArea->allocation.height;
rgbbuf = malloc (width * height * 3);
memset (rgbbuf, 240, width * height * 3); // set the background to GREY = (240, 240, 240)
//DrawBufferImage (rgbbuf, width, height, data);
gdk_draw_rgb_image (pixmap,
DrawingArea->style->fg_gc[GTK_STATE_NORMAL],
0, 0, width, height, GDK_RGB_DITHER_NONE, rgbbuf, width*3);
free (rgbbuf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment