Computer Science Canada Animated GIF in Turing |
Author: | tomorrow79 [ Wed May 08, 2013 8:28 pm ] |
Post subject: | Animated GIF in Turing |
Hi guys, I want to put in a GIF in Turing. But, everytime I run the program, it says "invalid picture ID number'0' ". Can you please help me fix this problem and make it work. Here is what I have so far: var picNum, pic : int := 0 loop if picNum not= 8 then picNum += 1 else picNum := 1 end if pic := Pic.FileNew ("agent" + intstr (picNum) + ".gif") Pic.Draw( pic, maxx div 2 - 75, maxy div 2 - 50, picCopy) end loop |
Author: | Dreadnought [ Wed May 08, 2013 10:28 pm ] |
Post subject: | Re: Animated GIF in Turing |
You're calling Pic.FileNew on the same 8 files over and over again effectively loading each one multiple times. Turing limits the number of pictures you can load to 1000. You're probably hitting that limit (at which point loading the picture fails and gives a picture ID of 0). You should only load each picture once and then call Pic.Draw in a loop. |