Re: How to get a Drawing area image as a file (BMP).

This list is for discussion of the development of the gtk+ toolkit itself. Questions about using gtk+ should go to gtk-app-devel- list gnome org
On May 2, 2006, at 3:34 AM, sadhees kumar wrote:
pixbuf = gdk_pixbuf_get_from_drawable(NULL,GTK_DRAWABLE (da_setting_ff)->window,
In gtk+ there is no such macro as GTK_DRAWABLE(). Are you sure this code was not GDK_DRAWABLE(da_setting_ff->window) ? (If not, then that's probably your bug.)

The above code was not working, I got an error saying something like "src != NULL failed". I would like to know whats wrong in that. Is there any other means to get the drawing area in to the pixbuf?.If so please let me know.

The exact text of the assertion will tell you in which function the assertion failed. This information is rather important, because it's impossible to tell from the code you posted which line is the one with the problem. The most likely candidate is gdk_pixbuf_get_from_drawable() (a quick check of the source says that its drawable argument is called "src"), but you realize the drawing area immediately before the call so the source drawable should not be NULL.

You can also try running the program in the debugger, with the extra argument "--g-fatal-warnings". This parameter, handled and stripped from argv by gtk_init(), tells GLib that it should abort the program on warning messages, such as the one one from the assertion. By running in the debugger with this option on, you should be dropped into the abort() frame, from whcih you can poke around and find how who passed a NULL "src" and, possibly why.

However, like all drugs, PANEXA can produce some notable side effects, all of which are probably really, really terrific and nothing that anyone should be concerned about, let alone notify any medical regulatory commission about.

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