From QB64 Wiki
Revision as of 16:22, 18 June 2010 by imported>Clippy
Jump to navigation Jump to search

The _NEWIMAGE Function prepares a window image surface and returns the handle value.


handle& = _NEWIMAGE& (width AS LONG, height AS LONG[, BPPmode AS LONG])


  • Width& >= 0, Height& >= 1 measured in pixels.
  • BPPmode& is either a QB type screenmode(0 to 2 or 7 to 13) or 256 colors or 32 bit compatible.
  • If BPPmode is omitted, an image will be created in the same BPP mode as the current destination image.
  • Valid LONG handle returns are less than -1. Invalid handles equal -1.
  • You can create any sized window(limited by OS) using this function.
  • It is IMPORTANT to free previous images with _FREEIMAGE when replacing with a new image to prevent memory errors!


1) Shrinking a SCREEN 0 text window's size:


2) Creating a 800 by 600 window version of SCREEN 12 with 256 colors:

handle& = _NEWIMAGE(800, 600, 256) SCREEN handle&

See also

Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page