Difference between revisions of "RESIZE (function)"
(Removes references to qb64.net)
m (Nomalise Availability section text)
|(One intermediate revision by one other user not shown)|
|Line 13:||Line 13:|
* Version 1.000 and up.
Latest revision as of 03:19, 8 March 2021
- The function returns -1 if a program screen resize was attempted by the user.
- After the function returns -1, _RESIZEWIDTH and _RESIZEHEIGHT can return the new requested dimensions in pixels.
- The $RESIZE:ON metacommand must be used so the program is created with a user resizable window.
- Version 1.000 and up.
Example: Resize the current screen image according to user's request.
$RESIZE:ON s& = _NEWIMAGE(300, 300, 32) SCREEN s& bee& = _LOADIMAGE("qb64_trans.png") 'replace with your own image DO IF _RESIZE THEN oldimage& = s& s& = _NEWIMAGE(_RESIZEWIDTH, _RESIZEHEIGHT, 32) SCREEN s& _FREEIMAGE oldimage& END IF CLS 'Center the image: x = _WIDTH / 2 - _WIDTH(bee&) / 2 y = _HEIGHT / 2 - _HEIGHT(bee&) / 2 _PUTIMAGE (x, y), bee& _DISPLAY _LIMIT 30 LOOP