6 posts
Location
Seeb,Muscat,Oman
Posted 09 June 2015 - 12:48 PM
Hello Programmers!Please help me fix this problem.I started to make a program,this is the startup image code:
local startupImage = paintutils.loadImage("startup")
paintutils.drawImage( startupImage,1,1 )
this is the error that I get when I run it:TurtleController:2: Expected image, x, ythe image is available and it is in the same directory as the program.
Please reply. :)/>
Edited on 09 June 2015 - 02:52 PM
3790 posts
Location
Lincoln, Nebraska
Posted 09 June 2015 - 04:16 PM
Moved to Ask a Pro.
656 posts
Posted 09 June 2015 - 04:22 PM
Is your imagefile called "startup"? And have you made your image in the build-in paint program?
6 posts
Location
Seeb,Muscat,Oman
Posted 09 June 2015 - 04:39 PM
Yes I did, the name is startup and i checked that several times
656 posts
Posted 09 June 2015 - 06:09 PM
Could you post the result of you typing "dir" in the console? (as a picture)
Edited on 09 June 2015 - 04:09 PM
6 posts
Location
Seeb,Muscat,Oman
Posted 09 June 2015 - 06:20 PM
How to upload a picture from my PC into my post?
3057 posts
Location
United States of America
Posted 09 June 2015 - 07:57 PM
I'd simply upload it to imgur or an equivalent image hosting site and post the link (or the BBC embed code).
7083 posts
Location
Tasmania (AU)
Posted 10 June 2015 - 01:27 AM
the image is available and it is in the same directory as the program.
If that directory isn't the root of your drive then you'll need to pass it to paintutils.loadImage, which requires absolute paths.
Eg, using
shell.resolve():
local startupImage = paintutils.loadImage(shell.resolve("startup"))
6 posts
Location
Seeb,Muscat,Oman
Posted 10 June 2015 - 02:53 AM
Could you post the result of you typing "dir" in the console? (as a picture)
this is the result:
the image is available and it is in the same directory as the program.
If that directory isn't the root of your drive then you'll need to pass it to paintutils.loadImage, which requires absolute paths.
Eg, using
shell.resolve():
local startupImage = paintutils.loadImage(shell.resolve("startup"))
Then what is the root directory? or should I only use shell.resolve() function as you did?
Edited on 10 June 2015 - 12:54 AM
6 posts
Location
Seeb,Muscat,Oman
Posted 10 June 2015 - 03:00 AM
I tried adding shell.resolve() function, and it WORKED FINALLY! thanks guys for your help! it is solved