GLBasic forum

Main forum => GLBasic - en => Topic started by: matchy on 2016-Sep-08

Title: SAVEBMP of screen whilst minimized?
Post by: matchy on 2016-Sep-08
Normally, it's fine even unfocused but how can I capture the screen when the server program is running minimized or perhaps even as a console?



Title: Re: SAVEBMP of screen whilst minimized?
Post by: spacefractal on 2016-Sep-09
Glbasic is not a screen grabber, designed with it as I'm know.

Savebmp just grab the game backbuffer.
Title: Re: SAVEBMP of screen whilst minimized?
Post by: matchy on 2016-Sep-09
I'm sorry I don't mean the OS desktop grab, I mean program game screen, i.e. the backbuffer.  :-[

SAVEBMP works with the window normalized or fullscreen with the game backbuffer but not when the window is minimized so that I can run the program as a server that's not in the way.  :(

Title: Re: SAVEBMP of screen whilst minimized?
Post by: dreamerman on 2016-Sep-09
You can always code some workaround, let say sprite to bmp function. Render backbuffer on sprite, use Sprite2Mem, then just loop through pixels and store them in plain file, add BMP format headers and done.
Normal 24bit bmp without RLE compression is pretty simple to create.
Title: Re: SAVEBMP of screen whilst minimized?
Post by: spacefractal on 2016-Sep-09
There is no graphics drawn when minimized.
Title: Re: SAVEBMP of screen whilst minimized?
Post by: matchy on 2016-Sep-09
Why aren't graphics be drawn when minimized? Not fair.  :'(

dreamerman has the idea and it's what I was thinking but not sure how with an existing 3d scene.  8)

The current solution for my image creation server is to place it on another OS virtual desktop, out of the way (haven't tried yet).  ::)
Title: Re: SAVEBMP of screen whilst minimized?
Post by: spacefractal on 2016-Sep-09
its clearly seen the graphics card dosent draw when not required, then its impossible to do that.

Its also a issue when im tried to save a screenshots from a bigger resolution as the game its self in windowered mode. That is also not possible (etc to create iPad snaps its).
Title: Re: SAVEBMP of screen whilst minimized?
Post by: dreamerman on 2016-Sep-11
lol. I forgot that there is SAVESPRITE function... :> with 'autopause false', it will save your offscreen sprite even when app is minimized.
Code (glbasic) Select
USESCREEN
//draw you stuff
SAVESPRITE

Spacefractal  generally yes, gpu doesn't draw when not needed but using USESCREEN you force it to render on sprite, you can of course do real size screenshots for iPad (on deskop pc), all depends how your gui stuff works, it's same as above, render game in iPad resolution to offscreen sprite, save it, rescale it down to pc resolution and draw on backbuffer to be able to play and gather screens from other game parts.
Title: Re: SAVEBMP of screen whilst minimized?
Post by: matchy on 2016-Sep-12
Okay, for now I'll use SAVESPRITE as it *does* work for a minimized server unlike SAVEBMP.  :good:
Title: Re: SAVEBMP of screen whilst minimized?
Post by: spacefractal on 2016-Sep-12
Im generally not use virtual screen due two issues:
- frame rate is by half.
- alpha multiply issue.

The last issue can still prevent me to use virtual screen on Windows for screenshot, but good idea and a good alternative.