QB64.com

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.

Syntax

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

Description

Example(s)

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
 _SCREENMOVE _MIDDLE

Sample code to save images to disk

See Also