Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Picture load
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mephi




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Kingnoz




PostPosted: Fri May 23, 2003 10:30 pm   Post subject: (No 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)
Mephi




PostPosted: 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


MMArena.zip
 Description:

Download
 Filename:  MMArena.zip
 Filesize:  790.68 KB
 Downloaded:  201 Time(s)

Dan




PostPosted: Fri May 23, 2003 10:49 pm   Post subject: (No 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
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Mephi




PostPosted: Fri May 23, 2003 10:53 pm   Post subject: (No subject)

o really? does Pic.Free help?
Tony




PostPosted: Fri May 23, 2003 11:41 pm   Post subject: (No 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...
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Martin




PostPosted: Sat May 24, 2003 1:31 am   Post subject: (No subject)

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.

P.S. Mmm...love the font tags Dan Very Happy
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: