Page 1 of 1
PB6.10 b5 Created Image fails being recognized.
Posted: Wed Feb 07, 2024 4:44 pm
by benubi
I can't reproduce the error in a short code; the code I use is approx. 1500 lines long (an incomplete terminal emulator).
Code: Select all
Img=CreateImage(-1,100,100)
Debug img ; returns a number
Debug IsImage(img) ; returns zero
StartDrawing(ImageOutput(Img)) ; fails / IMA
The image is apparently created, the first debug returns a number. But something does not work right and IsImage(img) returns zero.
I use OpenWindowedScreen() in the executables/demo codes, so maybe this could be linked, but in a short code it doesn't cause an error.
Re: PB6.10 b5 Created Image fails being recognized.
Posted: Wed Feb 07, 2024 4:55 pm
by STARGĂ…TE
Why do you post this question in the bug section, if you can't reproduce the error in a short code?
How should we reproduce the possible issue?
Where do you think the bug should be?
If IsImage(img) is null, then img is (no more) valid image number.
This could happen, when e.g. the image was freed.
Re: PB6.10 b5 Created Image fails being recognized.
Posted: Wed Feb 07, 2024 5:51 pm
by Demivec
Maybe it is related to the other bug involving #PB_Any (=-1).
Re: PB6.10 b5 Created Image fails being recognized.
Posted: Wed Feb 07, 2024 6:03 pm
by mk-soft
That's what I wanted to point out.
#PB_Any is '-1' and therefore dynamic PB objects are created. Do not use '-1' but #PB_Any to avoid confusion.
See PB-Help
PureBasic Objects
Re: PB6.10 b5 Created Image fails being recognized.
Posted: Thu Feb 08, 2024 6:01 am
by jacdelad
Just asking because most of us already have forgotten this at one point: Is "Img" an integer?
Re: PB6.10 b5 Created Image fails being recognized.
Posted: Thu Feb 08, 2024 9:06 pm
by mk-soft
Img must be a integer because its an pointer to memory array
Re: PB6.10 b5 Created Image fails being recognized.
Posted: Thu Feb 08, 2024 9:08 pm
by juergenkulow
Can you try to narrow down the IMA with
x64dbg or
OnErrorGoto(address, triggering command, register, stack and everything including the last MOV dword [CLN],nn)