Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_NEWIMAGE can't accept variables as dimensions?
#22
Yeah Ok sorry maybe I am the one confused.

Update: BUT it still works for me! @bobalooie

Code: (Select All)
Option _Explicit
Type object
    As Long img, wide, high
End Type

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
Dim test(4, 4) As object, A, B
A = 1: B = 2
testNewImage test(), A, B
Print test(A, B).img, test(A, B).wide, test(A, B).high


Sub testNewImage (outputObj() As object, A, B)
    Dim SCR&
    SCR& = _ScreenImage
    outputObj(A, B).wide = _Width(SCR&) / 2
    outputObj(A, B).high = _Height(SCR&) / 2

    outputObj(A, B).img = _NewImage(outputObj(A, B).wide, outputObj(A, B).high, 32)

    _PutImage , SCR&, outputObj(A, B).img, (0, 0)-(outputObj(A, B).wide - 1, outputObj(A, B).high - 1)
    Cls
    _PutImage , outputObj(A, B).img, 0
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-18-2026, 08:40 PM

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: 2 Guest(s)