{{DISPLAYTITLE:_SCREENIMAGE}}
The [[_SCREENIMAGE]] function stores the current desktop image or a portion of it and returns an image handle.


{{PageSyntax}}
: {{Parameter|imageHandle&amp;}} = [[_SCREENIMAGE]]({{Parameter|column1}}, {{Parameter|row1}}, {{Parameter|column2}}, {{Parameter|row2}})]


{{PageDescription}}
* {{Parameter|imageHandle&amp;}} is the handle to the new image in memory that will contain the desktop screenshot.
* The optional screen {{Parameter|column}} and {{Parameter|row}} positions can be used to get only a portion of the desktop image.
* The desktop image or partial image is always a 32-bit image. 
* The current screen resolution or width-to-height aspect ratio can be obtained with [[_DESKTOPWIDTH]] and [[_DESKTOPHEIGHT]].
* Can be used to take screenshots of the desktop or used with [[_PRINTIMAGE]] to print them.
* It is important to free unused or uneeded image handles with [[_FREEIMAGE]] to prevent memory overflow errors.
* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword not Supported in Linux or MAC versions]]


{{PageExamples}}
''Example:'' Determining the present screen resolution of user's PC for a screensaver program.
{{CodeStart}}
 desktop&amp; = {{Cl|_SCREENIMAGE}}
 MaxScreenX&amp; = {{Cl|_WIDTH (function)|_WIDTH}}(desktop&amp;)
 MaxScreenY&amp; = {{Cl|_HEIGHT}}(desktop&amp;)
 {{Cl|_FREEIMAGE}} desktop&amp; 'free image after measuring screen(it is not displayed)
 {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(MaxScreenX&amp;, MaxScreenY&amp;, 256) 'program window is sized to fit
 {{Cl|_SCREENMOVE}} _MIDDLE
{{CodeEnd}}


===Sample code to save images to disk===
*[[SAVEIMAGE]]
*[[Program ScreenShots]] (member-contributed program for legacy screen modes)
* [[ThirtyTwoBit SUB]]
* [[SaveIcon32]]



{{PageSeeAlso}}
* [[_SCREENCLICK]], [[_SCREENPRINT]]
* [[_SCREENMOVE]], [[_SCREENX]], [[_SCREENY]]
* [[_WIDTH (function)|_WIDTH]], [[_HEIGHT]]
* [[_DESKTOPWIDTH]], [[_DESKTOPHEIGHT]]
* [[_FULLSCREEN]], [[_PRINTIMAGE]]
* [[Screen Saver Programs]]
* [[Bitmaps]], [[Icons and Cursors]]
* [[Hardware images]]


{{PageNavigation}}
<
