RESIZEWIDTH: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:_RESIZEWIDTH}} The _RESIZEWIDTH function returns the user resized screen pixel width if $RESIZE:ON allows it and _RESIZE returns -1 {{PageSyntax}} : {{Parameter|newWidth&}} = _RESIZEWIDTH {{PageDescription}} * _RESIZE function must return true (-1) before the requested screen dimensions can be returned by the function. * The program should decide if the request is allowable for proper program i...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:_RESIZEWIDTH}}
{{DISPLAYTITLE:_RESIZEWIDTH}}
The [[_RESIZEWIDTH]] function returns the user resized screen pixel width if [[$RESIZE]]:ON allows it and [[_RESIZE (function)|_RESIZE]] returns -1  
The [[_RESIZEWIDTH]] function returns the user resized screen pixel width if [[$RESIZE]]:ON allows it and [[_RESIZE (function)|_RESIZE]] returns -1




Line 12: Line 12:




==Availability==
{{PageAvailability}}
* '''Version 1.000 and up'''.
* '''Version 1.000 and up'''.


Line 24: Line 24:
{{Cl|SCREEN}} s&
{{Cl|SCREEN}} s&


bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http://www.qb64.net/qb64_trans.png
bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image


{{Cl|DO}}
{{Cl|DO}}

Latest revision as of 02:13, 28 January 2023

The _RESIZEWIDTH function returns the user resized screen pixel width if $RESIZE:ON allows it and _RESIZE returns -1


Syntax

newWidth& = _RESIZEWIDTH


Description

  • _RESIZE function must return true (-1) before the requested screen dimensions can be returned by the function.
  • The program should decide if the request is allowable for proper program interaction.


Availability

  • Version 1.000 and up.


Examples

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") 'any image

DO
    IF _RESIZE THEN
        oldimage& = s&
        s& = _NEWIMAGE(_RESIZEWIDTH, _RESIZEHEIGHT, 32)
        SCREEN s&
        _FREEIMAGE oldimage&
    END IF

    CLS

    'Center the QB64 bee image:
    x = _WIDTH / 2 - _WIDTH(bee&) / 2
    y = _HEIGHT / 2 - _HEIGHT(bee&) / 2
    _PUTIMAGE (x, y), bee&
    _DISPLAY
    _LIMIT 30
LOOP


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link