07-24-2022, 08:21 PM
And here's a demo of using $RESIZE:ON to scale the screen, like you were originally intending:
Note that it's up to you to maintain the same aspect ratio, which I didn't do here to illustrate how things can "stretch" and distort if you don't do so when manually resizing like this.
Code: (Select All)
$Resize:On
activeScreen = _NewImage(640, 400, 256) '256 color screen so we can use _PUTIMAGE for scaling
viewScreen = _NewImage(640, 400, 256) 'a second screen to scale to
Screen viewScreen
_Dest activeScreen: _Source activeScreen
DrawBorder
_Delay .25
clearInitialResize = _Resize 'clear thr size change from where QB64 first starts up
Do
If _Resize Then
tempScreen = _NewImage(_ResizeWidth, _ResizeHeight, 256)
Screen tempScreen
_FreeImage viewScreen
viewScreen = tempScreen
End If
_PutImage , activeScreen, viewScreen
_Limit 30
Loop Until _KeyHit
System
Sub DrawBorder
Color 4
For x = 1 To _Width \ _FontWidth
Locate 1, x: Print Chr$(219);
Locate _Height \ _FontHeight, x: Print Chr$(219);
Next
For y = 1 To _Height \ _FontHeight
Locate y, 1: Print Chr$(219);
Locate y, _Width \ _FontWidth: Print Chr$(219);
Next
Color 15
Locate 3, 3: Print "Resize On, Scale-Size Demo"
Locate 5, 3: Print "Width:"; _Width
Locate 6, 3: Print "Height:"; _Height
End Sub
Note that it's up to you to maintain the same aspect ratio, which I didn't do here to illustrate how things can "stretch" and distort if you don't do so when manually resizing like this.