
-----------------------------------
RaPsCaLLioN
Sun Feb 06, 2005 1:14 pm

Pic.New decoding
-----------------------------------
Does anybody know how Pic.New saves an image as an integer?  Example: I save a 50x50 bitmap image w/ 3 colours to a variable (using Pic.New).  When I output that variable (put iObject) it puts "7003".

Can anybody decode this?

-----------------------------------
Delos
Sun Feb 06, 2005 2:36 pm


-----------------------------------
Your integer there is nothing more than a stream number.  It's not a real integer (sic.)

Now, as for streams...that's a different matter.

-----------------------------------
RaPsCaLLioN
Mon Feb 07, 2005 12:18 am


-----------------------------------
please elaborate...

-----------------------------------
Delos
Mon Feb 07, 2005 10:10 am


-----------------------------------
Ok...try this:


var pic : int
var name : string := "MyPic.bmp"

pic := Pic.FileNew (name)

put pic


On my comp, I got the int 7001.  You may get something different.  Now...in the editor window, click
Run -> Show Debugger Menu
Debugger -> Show Allocated Objects

Then run again.  You will notice in your Allocated Objects window 4 items...the first three being OOT windows (long story behind those too...had many a bad day dealing w/ those bloody -ve numbers), and a "Picture".  As you can see, its ID is quoted as 7001, and it also has a location.  I might be wrong about this, but it appears that the ID gives OOT a reference of where to look to find the pic/file to store in memory.

Perhaps someone else can confirm...wtd?
