02-17-2026, 02:34 AM
(This post was last modified: 02-17-2026, 02:35 AM by Unseen Machine.)
Lol, so the ' On line 2 is the cause of the woes!?
|
_NEWIMAGE can't accept variables as dimensions?
|
|
02-17-2026, 02:34 AM
(This post was last modified: 02-17-2026, 02:35 AM by Unseen Machine.)
Lol, so the ' On line 2 is the cause of the woes!?
There are lots of ways to get an illegal Function Call. Could be problem sharing variables with subs and likely is unrelated to using variables in _NewImage because I just showed that works ok, don't assume that is the only way to get an Illegal Function call.
(02-17-2026, 02:34 AM)Unseen Machine Wrote: Lol, so the ' On line 2 is the cause of the woes!? I had to delete that because it was flagging line 5, me doing a line without a graphics screen. At first I though it was flagging the _NewImage line , but no...
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
02-17-2026, 03:02 AM
@BPlus - We have resolved the question though right?
I am satisified _NewImage works fine using variables. It is classic hair puller when you misdiagnose the problem you are having with QB64. Until the problem is resolved, you can not assume you know the cause, that is a hard lesson.
It really does help when you can look at the code. Sometimes other people can see stuff jump right out that OP overlooks over and over again!
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
02-17-2026, 03:12 AM
Note that you have to use a value greater than 0 and less than 32000. Windows doesn’t support screens larger than this.
I’d check first variable name, value, ect. It may be a simple typo or such screwing you up. iy autocorrected to yi or such. LOL! You could also see that type error if $CONSOLE:ONLY is in place. Otherwise, there’s not a lot of things that can go wrong with that simple command.
Option _Explicit is great for catching typos, my first goto when something aint working when it's suppose to.
I even resorted to that testing _NewImage because my screen shot wasn't coming up, but no, I got source and destination backwards! on the PutImage to dest 0.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
02-17-2026, 03:28 AM
Quote:The iy values start at 16 and can be increased but never reduced.is it possible iy exceeded 32000+ limit for integers? which would make it go negative.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Did you ever get stuck on a word that is wrong one but damned if you can access the correct one.
I am that way with Alchemy, Phil's Game, I get stuck on algorithm. It's like that with coding problems, you get stuck with idea you are sure is causing the problem but it's not, it's some dumb other thing you aren't seeing.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
I found a solution:
In my program I have a UDT which included a LONG value to hold an image handle: Code: (Select All)
So, the call looked like this: Head(a,b).face = _NEWIMAGE(64, ix, 32) Apparently, _NEWIMAGE didn't like returning the handle to a UDT member. When I revised the code to break the images to their own simple array of LONG, _NEWIMAGE was happy. This worked: Code: (Select All)
I can't say whether or not this is expected behavior, but it got me over that hump. P.S. I always use OPTION _EXPLICIT
It's not the having, it's the doing.
I don't know, you might have misdiagnosed again. Here I output the _NewImage handle to an UDT Object Type just fine!
Code: (Select All)
And used object type properties for the variable arguments ta boot! This Code: (Select All) Head(a,b).face = _NEWIMAGE(64, ix, 32)
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
|
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| Setting mouse to ignore outside of _NewImage | PhilOfPerth | 11 | 737 |
12-18-2025, 07:20 PM Last Post: Pete |
|
| getting the number of dimensions in an array on the fly? | madscijr | 7 | 746 |
09-16-2025, 12:34 AM Last Post: madscijr |
|
| Why are SINGLE variables faster than INTEGER variables ? | Elzaimer | 18 | 2,374 |
07-07-2025, 05:01 AM Last Post: ahenry3068 |
|
| Why do FOR/NEXT variables end up +1 more? | Dav | 14 | 2,893 |
08-26-2023, 09:25 PM Last Post: Kernelpanic |
|