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

Username:   Password: 
 RegisterRegister   
 a little help with pic.draw please
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mr. Skittles




PostPosted: Mon Jun 20, 2005 6:31 pm   Post subject: a little help with pic.draw please

ok i am trying to have and image that comes down the screen and stops when it is at the bottom with all of the image visable... kinda like credits in a movie .... but it keeps giving me a "pic was freed" error what can i do to fix this? I honestly have no idea whats goign on and i would greatly appreceate any help.... thanks a million

loop
colourback (black)
cls
picy := picy - 10
Pic.Draw (picID, picx, picy, picCopy)
Pic.Free (picID)
end loop
if picy < 10 then
cls
colourback (white)
end if
Sponsor
Sponsor
Sponsor
sponsor
MysticVegeta




PostPosted: Mon Jun 20, 2005 6:40 pm   Post subject: (No subject)

Hi, Welcome to compsci!

1> Please use code tags
code:
as in
code:
loop
colourback (black)
cls
picy := picy - 10
Pic.Draw (picID, picx, picy, picCopy)
Pic.Free (picID)
end loop
if picy < 10 then
cls
colourback (white)
end if


neat eh?

2> about your problem
code:
if picy < 10 then
cls
exit
end if


try that?
Mr. Skittles




PostPosted: Mon Jun 20, 2005 6:52 pm   Post subject: (No subject)

Thanks man i will for sure use those tags next time..... but that didnt really help me i still and not getting it.... thanks tho
Token




PostPosted: Mon Jun 20, 2005 6:55 pm   Post subject: (No subject)

code:

loop
colourback (black)
picy := picy - 10
Pic.Draw (picID, picx, picy, picCopy)
cls
end loop
if picy < 10 then
cls
colourback (white)
end if


this is the whole code, what your doing is clearing the picture information in the variable picID when u use Pic.Free
Mr. Skittles




PostPosted: Mon Jun 20, 2005 7:22 pm   Post subject: (No subject)

ok ya that works but now it gives me a" illegal picture ID number "0" picture was not sucsessfully created" error..... what that about?
Mr. Skittles




PostPosted: Mon Jun 20, 2005 7:32 pm   Post subject: (No subject)

anyone? help me please?
Cervantes




PostPosted: Mon Jun 20, 2005 7:33 pm   Post subject: (No subject)

That means the picture was not successfully created. Incredibly, some of Turing's error messages are helpful! Probably, you misspelled the filename, messed up the extension, typed the path in wrong, or the image is not in the same folder as the turing file. Perhaps you're using an invalid file type, though I'm not sure if that would produce this error message.

EDIT: Give us time. The time between your two posts there was a grand total of 10 minutes. You have to have patience to succeed in this world.
[Gandalf]




PostPosted: Mon Jun 20, 2005 7:34 pm   Post subject: (No subject)

First you need to have a picture in the same directory, and then declare it in your program. Look in the tutorials section - first post will help.
Sponsor
Sponsor
Sponsor
sponsor
ZeroPaladn




PostPosted: Mon Jun 20, 2005 7:38 pm   Post subject: (No subject)

I have some code at school that might be able to help you. One problem, It's 8:30 PM here Rolling Eyes so ill post it tomorow.
Token




PostPosted: Mon Jun 20, 2005 7:41 pm   Post subject: (No subject)

Cervantes wrote:
You have to have patience to succeed in this world.


that is oh so true Laughing especially with turing
i think people take for granted the fact that there are constantly people looking to help on the siteand usually questions get answered so quickly
Mr. Skittles




PostPosted: Mon Jun 20, 2005 9:34 pm   Post subject: (No subject)

Thanks A LOT for all your help
MysticVegeta




PostPosted: Tue Jun 21, 2005 11:12 am   Post subject: (No subject)

code:
var picID := Pic.FileNew ("s1.jpg")
var picy : int := maxy
var picx : int := maxx div 2
loop
    colourback (black)
    cls
    picy := picy - 10
    Pic.Draw (picID, picx, picy, picCopy)
    exit when picy < 10
    delay (100)
end loop
colorback (255)
cls


Ok, i didn't pay attention to the Pic.Free you put there. This code saves memory thats being used up by turing. Everytime your code had to open the image file again and again. This saves time via memory.
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: