Computer Science Canada Pic.FileNew ??? |
Author: | ddndd [ Thu Jan 07, 2010 3:30 pm ] |
Post subject: | Pic.FileNew ??? |
im using this command but for some reason it is not working this is my code so far var picID: int picID := Pic.FileNew ("1.JPG") Pic.Draw (picID, x, y, picCopy) Pic.Free (picID) can you please tell me what it is wrong ?? i have turing 4.1.1 and 4.1 so ... |
Author: | andrew. [ Thu Jan 07, 2010 4:29 pm ] | ||
Post subject: | RE:Pic.FileNew ??? | ||
It should work. What error are you getting? Did you create an x and a y variable? If not, your code should have this at the top with your "var picID : int":
Also, maybe the picture "1.JPG" can't be found. The way you write it means that 1.JPG has to be in the same folder as your Turing file. |
Author: | ddndd [ Thu Jan 07, 2010 5:23 pm ] |
Post subject: | Re: Pic.FileNew ??? |
yes i do have the x and y and the pic is inside of the folder too !! it says illegal picture id number "0" or something like that !!!!!!! |
Author: | StuartG [ Thu Jan 07, 2010 5:50 pm ] |
Post subject: | RE:Pic.FileNew ??? |
Although this may sound dumb but did you save the turing file in the SAME folder as the picture? (I know this was already suggested but this is the only probable cause, that or your picture file isnt actually a JPG) |
Author: | andrew. [ Thu Jan 07, 2010 6:06 pm ] |
Post subject: | Re: Pic.FileNew ??? |
Illegal Picture ID number 0 means that the picture was not loaded properly. This could be because of a few different problems:
- It is not named 1.JPG - The filename may be case-sensitive. e.g. it won't work if the file is "1.jpg" or "1.jpeg" - The picture 1.JPG wasn't saved in a readable format for Turing. Try saving it again with Paint. Edit: Changed the bullet from "?" to "-" |
Author: | ddndd [ Thu Jan 07, 2010 9:12 pm ] |
Post subject: | Re: Pic.FileNew ??? |
got it finally the pic was saved wrong or something like that i used a diffrent pic and it worked so i just have to remake the pic thnx guys |