Computer Science Canada

Picture load

Author:  Mephi [ Fri May 23, 2003 10:19 pm ]
Post subject:  Picture load

often my program just stops and it sez "Illegal picture ID number '0'. (Probable cause: picture was not successfully created.)." Does any1 kno why this happens? the pictures there, it works fine fur a while, then just randomaly crashes

Author:  Kingnoz [ Fri May 23, 2003 10:30 pm ]
Post subject: 

try putting you picture in the same folder as your program.....works for me.....also the only files u can use are .bmp, .jpeg, .pcx(not sure about this one....never used it)

Author:  Mephi [ Fri May 23, 2003 10:34 pm ]
Post subject:  yea

its all in the same folder already, all my pics are .bmp....but it still keeps screwin up! mebbe its my comp or sumthin....iunno....can ppl test it out? see if it crashes for u....just walk around for a while, after about 15 seconds or sumthin it crashes fur me

Author:  Dan [ Fri May 23, 2003 10:49 pm ]
Post subject: 

i have not looked at code yet, but turing can only load so may pics. if you are loading new one each time a loop gose or sotming it will crash. i will look at code soon got a lot to do Confused

Author:  Mephi [ Fri May 23, 2003 10:53 pm ]
Post subject: 

o really? does Pic.Free help?

Author:  Tony [ Fri May 23, 2003 11:41 pm ]
Post subject: 

Pic.Free will crear the memory... You can also recycle variables instead of declearing a new one each time...

or if you load a lot of pictures during runtime, you could add something like

if picID <= 0 then
%image not loaded

and ether try to reload or use some replacement image for broken once...

Author:  Martin [ Sat May 24, 2003 1:31 am ]
Post subject: 

<span style="width:500; filter:glow(color=black, strength=3)"><font color=white>Make sure your pictures are 24 bit bitmaps. Turing has some trouble with other ones. Also, from experience, I've found that jpg's and jpeg's aren't very reliable. Also, for pictures where speed isn't really an issue (You're only drawing a few of them, or you're only drawing them once) use Pic.ScreenLoad instead of Pic.FileNew/Pic.Draw. Saves memory from the start.</span></font>

P.S. Mmm...love the font tags Dan Very Happy


: