Computer Science Canada I am getting random "Illegal picture ID" crashes |
Author: | kha.andrew [ Sun Jun 04, 2006 2:19 pm ] | ||
Post subject: | I am getting random "Illegal picture ID" crashes | ||
I am getting random crashes from my program. Here is a sample code
It isn't always at this code, sometimes at others, but sometimes is also works. The error message shown is: Quote: llegal picture ID number '0'. (Probable cause: picture was not successfully created.).
The picture is in the proper folder, the variable are properly declared Quote: var laptoppic : int
var laptopresize : int I have no idea why its crashing![/quote] |
Author: | TheOneTrueGod [ Sun Jun 04, 2006 2:22 pm ] |
Post subject: | |
lol, as it says, "probable cause: picture not created successfully" This is because you entered the picture name wrong, or the picture doesn't exist, or Turing doesn't support that file extension, or Turing screwed up when resizing it. |
Author: | kha.andrew [ Sun Jun 04, 2006 2:37 pm ] |
Post subject: | |
TheOneTrueGod wrote: lol, as it says, "probable cause: picture not created successfully"
This is because you entered the picture name wrong, or the picture doesn't exist, or Turing doesn't support that file extension, or Turing screwed up when resizing it. This picture will sometimes be drawn properly, sometimes not, it crashes at different places. I have this picture drawn many times throughout the whole program and it just crashes any time it wants! *The piture names are correct, picture DOES exist, it is the correct file extension and is supported Turing is probably just really buggy. Anyone have a fix for this.(I lose marks when presenting my program and it crashes. |
Author: | Cervantes [ Sun Jun 04, 2006 3:30 pm ] |
Post subject: | |
kha.andrew wrote: [
Turing is probably just really buggy. No, I don't think this is Turing's fault. There are a lot of reasons for this. (TOTG, this might be another question for the FAQ. ![]()
|
Author: | Mr. T [ Sun Jun 04, 2006 4:05 pm ] |
Post subject: | Alex's Opinion |
When the picture is not in use, use the Pic.Free command to free up some memory space. |
Author: | zylum [ Sun Jun 04, 2006 4:39 pm ] |
Post subject: | |
yeah, if you keep resizing the picture, make sure you free the previous picture or you will run out of memory.. |
Author: | TheOneTrueGod [ Sun Jun 04, 2006 4:41 pm ] |
Post subject: | |
That may be the problem, actually. If you "Pic.Free"d the picture somewhere in your code, then it won't be able to be drawn. Make sure there are no unexpected "Free"ing of your pictures. |
Author: | kha.andrew [ Sun Jun 04, 2006 4:57 pm ] |
Post subject: | |
I would like to make this really clear, the same piece of code that displays a picture will sometimes work perfectly and sometimes just crash unexpectedly. This is most likely not a coding problem. As for using Free.Pic, I only have a max of about 25 pics, and according to the documentations. "Turing has a limited number of pictures that are available at any one time (approximately 1,000). " so I don't think this is a problem. Anyone else have a fix? Or is turing just Bu99ed |
Author: | Dan [ Sun Jun 04, 2006 5:01 pm ] |
Post subject: | |
It's not a truing bug, pleas post more of your code for more help. |
Author: | kha.andrew [ Sun Jun 04, 2006 5:05 pm ] | ||
Post subject: | |||
here is more of the code |
Author: | Dan [ Sun Jun 04, 2006 5:12 pm ] | ||
Post subject: | |||
Well if you keep calling thos over and over you deftaly will run out of free pics and get an error. See just b/c you put a new value in the var dose not mean it gets ride of the pic. The pic is still loaded in to turing just now you do not have anything pointing to it. I whould try Pic.Free ing the pic you loaded at the end of each of thos procedures. Also when you scale a pic it creates a new one, so you should also free thos at the end of the procedures as well. So at the end of each one add somthing like:
|
Author: | kha.andrew [ Sun Jun 04, 2006 5:48 pm ] |
Post subject: | |
Thanks, works great!! Hasn't crashed ever since I put it in. ![]() |
Author: | kha.andrew [ Sun Jun 04, 2006 6:17 pm ] |
Post subject: | |
Ok, I take back what I said. It just crashed!! Big time! Everything I've done in the last 2 hours is gone! The whole Turing program Crashed, its says the back will be saved as filename.sav but its not there! OMG! I should really try and save more ofter, or even better Turing should AUTOSAVE! |
Author: | zylum [ Sun Jun 04, 2006 10:11 pm ] |
Post subject: | |
kha.andrew wrote: Ok, I take back what I said. It just crashed!! Big time! Everything I've done in the last 2 hours is gone! The whole Turing program Crashed, its says the back will be saved as filename.sav but its not there!
OMG! I should really try and save more ofter, or even better Turing should AUTOSAVE! if it said its saved, then it should be.. it just might be saved somewhere else ![]() |
Author: | zylum [ Sun Jun 04, 2006 10:21 pm ] |
Post subject: | |
also, make sure you free all pictures that you dont need any longer. it might have crashed because you missed one. |
Author: | Dan [ Mon Jun 05, 2006 12:34 am ] |
Post subject: | |
1st of all if you ask some one who has programed for some time they almost allways save before they complie and/or run there progarm. In fact most IDEs will force you to save your code before you complie/run it. And even if you are not progaming, save, save, save!!!! You never know when the power is going to go out or some evil being will come and kill your computer. As for the error, i recall geting errors like that in the past as well but they where almost always a one time thing and due to the turing IDE and not my code. However if you keep geting it i whould check every place you are calling Pic.New or Pic.Scale and make shure you free that pic as soon as you are done with it. Rember that just calling Pic.New on the var again dose not free it and just makes it very hard to find that pic again. |