QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The _SCREENIMAGE function stores the current desktop image or a portion of it and returns an image handle.


imageHandle& = _SCREENIMAGE(column1, row1, column2, row2)]



Determining the present screen resolution of user’s PC for a screensaver program.

 desktop& = _SCREENIMAGE
 MaxScreenX& = _WIDTH(desktop&)
 MaxScreenY& = _HEIGHT(desktop&)
 _FREEIMAGE desktop& 'free image after measuring screen(it is not displayed)
 SCREEN _NEWIMAGE(MaxScreenX&, MaxScreenY&, 256) 'program window is sized to fit

Sample code to save images to disk

See Also