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
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
milkislife




PostPosted: Thu May 07, 2009 10:52 am   Post subject: Illegal picture ID

Hmmm...
I've done a bit of searching on this forum, and I've come to a conclusion...
There is no conclusion to the problem: Illegal Picture ID "0".
Is there no general solution?
Thanks to all who help.
Sponsor
Sponsor
Sponsor
sponsor
Kharybdis




PostPosted: Thu May 07, 2009 11:27 am   Post subject: RE:Illegal picture ID

i think that means that no picture was found..
Dan




PostPosted: Thu May 07, 2009 12:08 pm   Post subject: RE:Illegal picture ID

It would help to see your code but it means that the ID (number) you are passing to the picture realted function (probaly threw a varible) dose not belong to a picture.

There are alot of reasons this could be so it's hard to help with out seeing your code.

Make sure you aucataly loaded the picture in secusfully and that you have not freed the picture before trying to use it.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
milkislife




PostPosted: Thu May 07, 2009 12:39 pm   Post subject: Re: Illegal picture ID

I'm an assitant to a class, I'm not too new to turing, but I'm not too advanced..
Lol, I'm better at finding problems, then making my own programs. Wink
It was one of my students programs, and he is making a hunting game. Basically, after selecting one of the available options from the menu, the screen clears, a forest background picture comes up, and a timer starts. Whilst all this is happening, animals are appearing randomly from right to left. (specifically a bird, and a deer).
The one minute game(otion 1 on the menu) works fine, but in the five minute(option two), randomly in the middle of the program, I believe, it's the background picture, that becomes 'illegal'.
Kharybdis




PostPosted: Thu May 07, 2009 1:13 pm   Post subject: RE:Illegal picture ID

You probably have an error somewhere either redefining the picture ID or you are using the wrong picture for the ID. Check your code...
If you don't succeed in finding the error, post your code using language tags so we can see what the error might be.

Look at the relationship between the code of 'option 1' and 'option 2' and see if you can stop the differences for the ID (s) required.
milkislife




PostPosted: Thu May 07, 2009 1:29 pm   Post subject: Re: RE:Illegal picture ID

Kharybdis @ Thu May 07, 2009 1:13 pm wrote:
You probably have an error somewhere either redefining the picture ID or you are using the wrong picture for the ID. Check your code...
If you don't succeed in finding the error, post your code using language tags so we can see what the error might be.

Look at the relationship between the code of 'option 1' and 'option 2' and see if you can stop the differences for the ID (s) required.


I just think the problems a bit random., becuase it doesn't happen unitl like, halfway throught the game.
Dusk Eagle




PostPosted: Thu May 07, 2009 1:41 pm   Post subject: Re: Illegal picture ID

Yes, but computers don't work on dicework. There is a clear, definable, solvable problem here, and by checking the code yourself or allowing us to check it for you, the problem can be isolated and a solution obtained.
Shanethe13




PostPosted: Thu May 07, 2009 9:33 pm   Post subject: RE:Illegal picture ID

It sounds like the problem is in the actual loading of the picture. Make sure that the student spelled the filename correctly, and that the extension is included.

I'm thinking that it is just a simple typo in one of the filenames, so it is throwing an error when it tries to draw the picture.
Sponsor
Sponsor
Sponsor
sponsor
copthesaint




PostPosted: Fri May 08, 2009 7:45 am   Post subject: RE:Illegal picture ID

If the problem is that you are not able to make the picture half way into the program then you Are making too many pictures. Make sure that if you are declairing a variable a picture in a loop, make sure you Pic.Free (var (picture var) : int) at the end of the loop.
chopperdudes




PostPosted: Tue May 12, 2009 10:27 pm   Post subject: RE:Illegal picture ID

yes you need to free the picture. This happened to me in my mario game. there are soo many variables in it that i was only able to die 8 times before running out of memory.

be sure to Pic.Free all your pictures at the end of the loop if it was declared inside the loop.
Dusk Eagle




PostPosted: Tue May 12, 2009 10:31 pm   Post subject: Re: Illegal picture ID

Why are you declaring pictures in a loop anyway? Is there ever a situation where that is useful?
DanTheMan




PostPosted: Thu May 14, 2009 11:16 am   Post subject: RE:Illegal picture ID

Just saying, you gotta have the correct picture name with the file type at the end.
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  [ 12 Posts ]
Jump to:   


Style:  
Search: