> On Tuesday, May 10, 2011 14:14:11 Benoît Minisini wrote: > > > Question on Gambas 3 > > > > > > I need to find pixelcolor from a drawingarea painted with the draw > > > event. I tried already several variants of drawingarea.grab but always > > > fail. > > > > > > the help for Grab is weak and typeof(drawingarea.grab) gives 13 > > > (function) > > > > > > goal is to select pixel (drawn object as lines is not possible i gues) > > > when on mouse.move over drawingarea. > > > > > > wally > > > > You can't, because the DrawingArea contents is stored inside the X server > > (or the graphic card). This is a X11 thing. > > > > You have to use an intermediate Image object in memory. > > > > Regards, > > that's what i tried using grab(). no idea how this works > just a an example line for gb3, is highly welcome :) > thx >
Grab() takes a screenshot in Gambas 2. In Gambas 3, you cannot take a screenshot of a control anymore, and the Grab() method does something else. It temporarily grabs the keyboard and the mouse so that the control gets all keyboard and mouse events, like a popup menu. So you have to use an intermediate Image for your drawings if you need the value of individual pixels. Regards, -- Benoît Minisini ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user