Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_NEWIMAGE can't accept variables as dimensions?
#9
Works fine for me _NewImage with variables in a sub:
Code: (Select All)
Option _Explicit
Screen _NewImage(800, 600, 32): _ScreenMove 280, 60
Dim I
For I = 1 To 100
    Line (Rnd * _Width, Rnd * _Height)-(Rnd * _Width, Rnd * _Height), _RGB32(Rnd * 255), BF
Next
Sleep
testNewImage


Sub testNewImage
    Dim SCR&, W, H, SQUARTER&
    SCR& = _ScreenImage
    W = _Width(SCR&) / 2
    H = _Height(SCR&) / 2

    SQUARTER& = _NewImage(W, H, 32)

    _PutImage , SCR&, SQUARTER&, (0, 0)-(W - 1, H - 1)
    Cls
    _PutImage , SQUARTER&, 0
    Print SCR&, W, H, SQUARTER&
End Sub

  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: _NEWIMAGE can't accept variables as dimensions? - by bplus - 02-17-2026, 02:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Setting mouse to ignore outside of _NewImage PhilOfPerth 11 712 12-18-2025, 07:20 PM
Last Post: Pete
  getting the number of dimensions in an array on the fly? madscijr 7 721 09-16-2025, 12:34 AM
Last Post: madscijr
  Why are SINGLE variables faster than INTEGER variables ? Elzaimer 18 2,330 07-07-2025, 05:01 AM
Last Post: ahenry3068
  Why do FOR/NEXT variables end up +1 more? Dav 14 2,832 08-26-2023, 09:25 PM
Last Post: Kernelpanic

Forum Jump:


Users browsing this thread: 1 Guest(s)