Computer Science Canada Having troubles putting pictures into turing code. |
Author: | Dwagz [ Wed Mar 23, 2011 4:26 pm ] |
Post subject: | Having troubles putting pictures into turing code. |
Hello all. I'm fairly new to turing and programming in general. So be patient :p. So I'm trying to put a picture into my trivia program. I looked at the tutorial for this and wrote the code how it told me to. The problem is that when I hit run it says "Illegal picture ID number '0'" Here is the code: var pic :int := Pic.FileNew ("sc2.bmp") Pic.Draw (pic, maxx div 2, maxy div 2, 0) put pic Im using 4.1.1 btw. |
Author: | Insectoid [ Wed Mar 23, 2011 5:20 pm ] |
Post subject: | RE:Having troubles putting pictures into turing code. |
Turing isn't loading the image. Is the picture in the same folder as the source code? |
Author: | Dwagz [ Wed Mar 23, 2011 7:27 pm ] |
Post subject: | Re: Having troubles putting pictures into turing code. |
Ahh you're right! That was the problem. Only this is at the top left corner there is a number (7001). Can I get rid of that? |
Author: | Insectoid [ Wed Mar 23, 2011 10:30 pm ] |
Post subject: | RE:Having troubles putting pictures into turing code. |
Are you calling this inside a loop? Turing can't load infinite pictures you know. After you've loaded X pictures, Turing quits. Look up 'Pic.Free'. |
Author: | DemonWasp [ Thu Mar 24, 2011 9:29 am ] |
Post subject: | RE:Having troubles putting pictures into turing code. |
The line put pic will output the integer ID for that picture, which in this case happens to be 7001. Remove that line to remove the output. |
Author: | Insectoid [ Thu Mar 24, 2011 9:42 am ] |
Post subject: | RE:Having troubles putting pictures into turing code. |
Ah, good call Demonwasp. Didn't see that. |