Sorry, Murphy didn't change in 2008. 2 hours tracked for a bug, nothing found, posted the problem, 2 minutes later the bug was found ... I referred to a pixmap, not the image.
Anyway: What means this g_assert_not_reached incident in general? Has anybody an idea?
cu
Croco
-----------------------------------------------
Hi folks!
Glib 2.12, GTK 2.10 for Windows:
I'm quite new to GTK and about to work with 2D graphics in drawing areas. I have some trouble to readout single pixmap pixels (and to set their color as well). Hence I couldn't find some method to do this directly on pixmaps, I convert the pixmaps to images in order to use gdk_image_get_pixel() afterwards as it is described in an example code here in the forum. Unfortunatly GDK replies my effort with a strange message:
"Gdk-Error **: file gdkimage-win32.c: line 317 (gdk_image_get_pixel): should not be reached
aborting..."
Here the code:
Code:
Function omagtk_pixmap_getpixel(obj as tomagtk_pixmap ptr, x as integer, y as integer) as guint32
dim as GdkImage ptr img
dim as guint32 retval
img=gdk_drawable_get_image(obj->pix,0,0,obj->nx,obj->ny)
if (obj->pix=NULL) then brkmess("Error in omagtk_pixmap_getpixel(): pixmap not initialized")
if (x<0 or x>obj->nx-1 or y<0 or y>obj->nx-1) then brkmess("Error in omagtk_pixmap_getpixel(): coordinates boundary error")
retval= gdk_image_get_pixel(obj->pix, x , y )
Function=retval
End Function
Has anybody an idea what's going wrong here? Thank you very much in advance!
Croco