Difference between revisions of "RESIZEHEIGHT"

From QB64 Wiki
Jump to navigation Jump to search
imported>SMcNeill
(availability)
m (Nomalise Availability section text)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:_RESIZEHEIGHT}}
{{DISPLAYTITLE:_RESIZEHEIGHT}}
The [[_RESIZEHEIGHT]] function returns the user re-sized screen pixel width if [[$RESIZE]]:ON allows it and [[_RESIZE (function)|_RESIZE]] returns -1  
The [[_RESIZEHEIGHT]] function returns the user resized screen pixel height if [[$RESIZE]]:ON allows it and [[_RESIZE (function)|_RESIZE]] returns -1  




{{PageSyntax}}
{{PageSyntax}}
::: newHeight& = '''_RESIZEHEIGHT'''
: {{Parameter|newHeight&}} = [[_RESIZEHEIGHT]]




''Details:''
{{Parameter|Details:}}
* [[_RESIZE (function)|_RESIZE]] function must return -1 before the requested screen dimensions can be returned by the function.
* [[_RESIZE (function)|_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 interactions and view-ability.
* The program should decide if the request is allowable for proper program interaction.




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




''See also:''
{{PageExamples}}
* [[$RESIZE]] {{text|(ON allows user to resize)}}
''Example:'' Resize the current screen image according to user's request.
* [[_RESIZE (function)]] {{text|(returns user resize request)}}
{{CodeStart}}
{{Cl|$RESIZE}}:ON
 
s& = {{Cl|_NEWIMAGE}}(300, 300, 32)
{{Cl|SCREEN}} s&
 
bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'replace with your own image
 
{{Cl|DO}}
    {{Cl|IF}} {{Cl|_RESIZE (function)|_RESIZE}} THEN
        oldimage& = s&
        s& = _NEWIMAGE(_RESIZEWIDTH, _RESIZEHEIGHT, 32)
        SCREEN s&
        {{Cl|_FREEIMAGE}} oldimage&
    END IF
 
    {{Cl|CLS}}
 
    'Center the QB64 bee image:
    x = {{Cl|_WIDTH (function)|_WIDTH}} / 2 - _WIDTH(bee&) / 2
    y = {{Cl|_HEIGHT}} / 2 - _HEIGHT(bee&) / 2
    {{Cl|_PUTIMAGE}} (x, y), bee&
    {{Cl|_DISPLAY}}
    {{Cl|_LIMIT}} 30
{{Cl|LOOP}}
{{CodeEnd}}
 
 
{{PageSeeAlso}}
* [[$RESIZE]]
* [[_RESIZE (function)]]
* [[_RESIZEWIDTH]]
* [[_RESIZEWIDTH]]




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 03:18, 8 March 2021

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


Syntax

newHeight& = _RESIZEHEIGHT


Details:

  • _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") '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 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:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page