This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
BionicSloth's profile picture

Paint loadImage and drawImage

Started by BionicSloth, 01 July 2014 - 11:52 AM
BionicSloth #1
Posted 01 July 2014 - 01:52 PM
Hello! I have been trying to load up an image on my advanced computer that I drew on the Paint program. I created an image named frame1 so when I wanted the image to be drawn on my computer screen I did:

local image = paintutils.loadImage("frame1")
paintutils.drawImage(image, 1, 1)
But, whenever I try to run the file I saved this code in, which I named "tv" it says this: "tv:2 Expected image, x, y". Any help is greatly appreciated! ~Thanks :lol:/>
Bomb Bloke #2
Posted 01 July 2014 - 03:41 PM
This suggests "frame1" isn't a loadable image. Can you re-open it in Paint? Is both the image file and this script stored on the root of the computer's drive, or are they in a subfolder?
BionicSloth #3
Posted 01 July 2014 - 05:26 PM
Whenever I open "frame1", it opens a file filled with numbers which I'm guessing are the color codes. The image and the file are both in the same floppy disk. Is there a way to make "frame1" a loadable image?
Lyqyd #4
Posted 01 July 2014 - 05:32 PM
You need to specify the full path, so try changing the loadImage call to use "disk/frame1".
BionicSloth #5
Posted 01 July 2014 - 05:40 PM
Thank you Lyqyd and Bomb Bloke for your help! The image was able to load when I did "disk/frame1" :D/>