On Sat, 19 Jul 2014, Jack wrote: > Le 18/07/2014 15:09, Tobias Boege a ?crit : > > By "screen" you mean the whole desktop, not just your SDL window, right? > > Excuse me Tobi. I was not very clear. Screen for me is only sdl window. > it's the working screen defined by the Gambas program. >
OK. Next thing to notice is that you are using the Draw event to paint your window. To grab a rectangle (x,y,w,h) from your screen you can do something similar to: - define a Private $bMakeScreenshot As Boolean and set it to True whenever you want to make a screenshot (set it to False after every Draw event) - define Private $iX, $iY, $iW, $iH As Integer which specify the rectangle to grab in case $bMakeScreenshot is True. - in your Draw event handler, if $bMakeScreenshot is True, do not draw immediately to the screen but to an intermediate Image object. Then draw the Image to the screen and extract your screenshot from the Image. Once you set $bMakeScreenshot, you will get a screenshot of the next frame. HOWEVER, as I was trying to implement this (see attached project), I saw in the documentation that gb.sdl is currently (?) not capable of drawing to an Image. Without that, I fear that you can't do that with gb.sdl - at least I am out of ideas at this point. I bet it would work if only we were able to draw to an Image... Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk
sdltest-0.0.1.tar.gz
Description: Binary data
------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds
_______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user