
-----------------------------------
Mr. Skittles
Mon Jun 20, 2005 6:31 pm

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

-----------------------------------
MysticVegeta
Mon Jun 20, 2005 6:40 pm


-----------------------------------
Hi, Welcome to compsci!

1> Please use code tags  as in
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 if picy < 10 then
cls
exit 
end if


try that?

-----------------------------------
Mr. Skittles
Mon Jun 20, 2005 6:52 pm


-----------------------------------
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
Mon Jun 20, 2005 6:55 pm


-----------------------------------

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
Mon Jun 20, 2005 7:22 pm


-----------------------------------
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
Mon Jun 20, 2005 7:32 pm


-----------------------------------
anyone? help me please?

-----------------------------------
Cervantes
Mon Jun 20, 2005 7:33 pm


-----------------------------------
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]
Mon Jun 20, 2005 7:34 pm


-----------------------------------
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.

-----------------------------------
ZeroPaladn
Mon Jun 20, 2005 7:38 pm


-----------------------------------
I have some code at school that might be able to help you. One problem, It's 8:30 PM here :roll: so ill post it tomorow.

-----------------------------------
Token
Mon Jun 20, 2005 7:41 pm


-----------------------------------
You have to have patience to succeed in this world.

that is oh so true  :lol: 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
Mon Jun 20, 2005 9:34 pm


-----------------------------------
Thanks A LOT for all your help

-----------------------------------
MysticVegeta
Tue Jun 21, 2005 11:12 am


-----------------------------------
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.
