BASIC

Author Topic: SAVEBMP of screen whilst minimized?  (Read 1660 times)

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1538
    • View Profile
SAVEBMP of screen whilst minimized?
« 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?




Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3417
    • View Profile
    • Space Fractal
Re: SAVEBMP of screen whilst minimized?
« Reply #1 on: 2016-Sep-09 »
Glbasic is not a screen grabber, designed with it as I'm know.

Savebmp just grab the game backbuffer.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1538
    • View Profile
Re: SAVEBMP of screen whilst minimized?
« Reply #2 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.  :(


Offline dreamerman

  • Mr. Polyvector
  • ***
  • Posts: 176
    • View Profile
    • my personal website
Re: SAVEBMP of screen whilst minimized?
« Reply #3 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.
Check my source code editor for GLBasic - link

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3417
    • View Profile
    • Space Fractal
Re: SAVEBMP of screen whilst minimized?
« Reply #4 on: 2016-Sep-09 »
There is no graphics drawn when minimized.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1538
    • View Profile
Re: SAVEBMP of screen whilst minimized?
« Reply #5 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).  ::)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3417
    • View Profile
    • Space Fractal
Re: SAVEBMP of screen whilst minimized?
« Reply #6 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).
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline dreamerman

  • Mr. Polyvector
  • ***
  • Posts: 176
    • View Profile
    • my personal website
Re: SAVEBMP of screen whilst minimized?
« Reply #7 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.
Check my source code editor for GLBasic - link

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1538
    • View Profile
Re: SAVEBMP of screen whilst minimized?
« Reply #8 on: 2016-Sep-12 »
Okay, for now I'll use SAVESPRITE as it *does* work for a minimized server unlike SAVEBMP.  :good:

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3417
    • View Profile
    • Space Fractal
Re: SAVEBMP of screen whilst minimized?
« Reply #9 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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.