Difference between revisions of "NEWIMAGE"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 7: Line 7:
  
 
{{PageDescription}}
 
{{PageDescription}}
* Width& >= 0, Height& >= 1 measured in pixels.  
+
* Minimum screen dimensions are 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.
+
* BPPmode& is either a QB type screenmode(0 to 2 or 7 to 13) or 256 colors or 32 bit(high color) compatible.
 
* If BPPmode is omitted, an image will be created in the same BPP mode as the current destination image.
 
* If BPPmode is omitted, an image will be created in the same BPP mode as the current destination image.
 
* Valid {{KW|LONG}} handle returns are less than -1. Invalid handles equal -1.
 
* Valid {{KW|LONG}} handle returns are less than -1. Invalid handles equal -1.
 
* You can create any sized window(limited by OS) using this function.
 
* You can create any sized window(limited by OS) using this function.
* It is IMPORTANT to free unused or uneeded images with {{KW|_FREEIMAGE}} to prevent memory overflow errors!
+
* It is IMPORTANT to free unused or uneeded images with {{KW|_FREEIMAGE}} to prevent CPU [[ERROR Codes|memory overflow errors]]!
  
  
Line 24: Line 24:
  
  
2) Creating a 800 by 600 window version of SCREEN 12 with 256 colors:
+
2) Creating an 800 by 600 window version of SCREEN 12 with 256 colors (text 36 X 100):
 
{{CodeStart}}
 
{{CodeStart}}
  
Line 40: Line 40:
 
*{{KW|_PUTIMAGE}}
 
*{{KW|_PUTIMAGE}}
 
*{{KW|_SCREENIMAGE}}
 
*{{KW|_SCREENIMAGE}}
 
+
*{{KW|SCREEN (statement)}}
  
  
 
{{PageNavigation}}
 
{{PageNavigation}}

Revision as of 08:23, 8 July 2010

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


Syntax

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


Description

  • Minimum screen dimensions are 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(high color) 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 unused or uneeded images with _FREEIMAGE to prevent CPU memory overflow errors!


Examples

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

SCREEN _NEWIMAGE(28, 25, 0)


2) Creating an 800 by 600 window version of SCREEN 12 with 256 colors (text 36 X 100):

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



See also



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