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

Username:   Password: 
 RegisterRegister   
 Animated GIF in Turing
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
tomorrow79




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: 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.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: