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

Username:   Password: 
 RegisterRegister   
 Illegal picture ID Problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Vertico




PostPosted: Thu Apr 28, 2005 6:06 pm   Post subject: Illegal picture ID Problem

Not completly sure why this is happening. It will run right for a bit then it will crash with this error

code:

Illegal picture ID number '0'. (Probable cause: picture was not successfully created).


Someone figure this out for me plz.



Test.zip
 Description:

Download
 Filename:  Test.zip
 Filesize:  4.26 KB
 Downloaded:  109 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Token




PostPosted: Thu Apr 28, 2005 6:25 pm   Post subject: (No subject)

here, give this a go. what you had to do is free the picID before you re-assigned it or else it would build up on that one variable. so just put
code:

            Pic.Free (picID)

before
code:

            picID := Pic.FileNew ("verticomanStand.bmp")



but this dosent make sence for the error you were getting, make sure all the files are in the same folder. so try that and double check the location of ur files



test.zip
 Description:

Download
 Filename:  test.zip
 Filesize:  4.27 KB
 Downloaded:  118 Time(s)

c0bra54




PostPosted: Thu Apr 28, 2005 6:52 pm   Post subject: (No subject)

no it does make sense.. what ends up happening is when you go
Pic.FileNew ("")

and open a different pocture in variable more then 1000 times it crashes, probly something to do with tuirng's memory componenets.. the easiest way to fix this if you are making a game or somethin, is to have a Pic.Free pocedure, that will free all the pictures in your game, and run it everytime your main loop executes.. i first ran into this problem with animation..

yeh, thats all Razz
Token




PostPosted: Thu Apr 28, 2005 8:32 pm   Post subject: (No subject)

yah, the code i posted fixes that problem, i never ran into the

code:

Illegal picture ID number '0'. (Probable cause: picture was not successfully created).


problem of which he speaks << words reversed to seem classy Laughing , ne ways yah that error is usually when it cant find the file.
c0bra54




PostPosted: Thu Apr 28, 2005 8:36 pm   Post subject: (No subject)

omg lol your right there error i am thinking of is like..
error illegal piture id (int execceds 1000)
or sumthing Razz

sry lol
Vertico




PostPosted: Fri Apr 29, 2005 9:29 am   Post subject: (No subject)

ya okay it works now when I free it. Thz
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  [ 6 Posts ]
Jump to:   


Style:  
Search: