GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Oct 31, 2014 9:06 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: [Solved] Problem with gdk_image_get_pixel()
PostPosted: Fri Jan 04, 2008 7:50 am 
Offline

Joined: Fri Jan 04, 2008 7:29 am
Posts: 4
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 10:39 pm 
Offline
Familiar Face

Joined: Tue Dec 11, 2007 11:03 pm
Posts: 11
Location: Burleson, TX
Hi! You marked this as solved but I found some info on "g_assert_not_reached()"

From http://developer.gnome.org/doc/GGAD/cha-glib.html
g_assert_not_reached() should be used to mark "impossible" situations...

Also, what programming language is that? It looks like some form of basic.

Good luck.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 05, 2008 12:15 am 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
Oh that does look like Basic.... is there a basic wrapper for GTK I'm not aware of?

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 05, 2008 1:47 pm 
Offline

Joined: Fri Jan 04, 2008 7:29 am
Posts: 4
It's Freebasic:
http://www.freebasic.net

Originally some kind of 32-bit successor of good old QuickBasic, it works on Linux as well and has now roughly the capabilities of C and there are binding for some dozen of libs like OpenGL, Newton, SDL, MySQL, Allegro, Lua, GTK and many more.

Cu

Croco


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group