PB6.10 b5 Created Image fails being recognized.

Just starting out? Need help? Post your questions and find answers here.
benubi
Enthusiast
Enthusiast
Posts: 227
Joined: Tue Mar 29, 2005 4:01 pm

PB6.10 b5 Created Image fails being recognized.

Post 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.
User avatar
STARGÅTE
Addict
Addict
Posts: 2260
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: PB6.10 b5 Created Image fails being recognized.

Post 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.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
Demivec
Addict
Addict
Posts: 4281
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: PB6.10 b5 Created Image fails being recognized.

Post by Demivec »

Maybe it is related to the other bug involving #PB_Any (=-1).
User avatar
mk-soft
Always Here
Always Here
Posts: 6320
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB6.10 b5 Created Image fails being recognized.

Post 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
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
jacdelad
Addict
Addict
Posts: 2032
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: PB6.10 b5 Created Image fails being recognized.

Post by jacdelad »

Just asking because most of us already have forgotten this at one point: Is "Img" an integer?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
mk-soft
Always Here
Always Here
Posts: 6320
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB6.10 b5 Created Image fails being recognized.

Post by mk-soft »

Img must be a integer because its an pointer to memory array
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
juergenkulow
Enthusiast
Enthusiast
Posts: 581
Joined: Wed Sep 25, 2019 10:18 am

Re: PB6.10 b5 Created Image fails being recognized.

Post 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)
Post Reply