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

Storing An Image as a table to be loaded within the program

Started by thewmatt, 02 September 2014 - 01:38 AM
thewmatt #1
Posted 02 September 2014 - 03:38 AM
i would like to know how to store an paintutils compatible image as a table to be loaded within the main program…
please help!
Bomb Bloke #2
Posted 02 September 2014 - 05:00 AM
Loaded how? From a file? How do you intend to create the image?
thewmatt #3
Posted 11 September 2014 - 05:00 AM
Loaded how? From a file? How do you intend to create the image?
Im trying to make a image as a table. like when you use paintutils.loadImage(), except the image table will be in the program instead of needing loaded by paintutils at all
Lyqyd #4
Posted 11 September 2014 - 05:15 AM
You could try loading it from a saved file with paintutils, then serialize the resulting image table and save it, then copy the serialized table into your program.
thewmatt #5
Posted 16 September 2014 - 05:03 AM
You could try loading it from a saved file with paintutils, then serialize the resulting image table and save it, then copy the serialized table into your program.
thanks! (:
thewmatt #6
Posted 16 September 2014 - 05:15 AM
You could try loading it from a saved file with paintutils, then serialize the resulting image table and save it, then copy the serialized table into your program.
thanks! (:
um, how do i save it :huh:/>
Edited on 16 September 2014 - 03:15 AM
Bomb Bloke #7
Posted 16 September 2014 - 05:18 AM
local fileHandle = fs.open("someFile","w")
fileHandle.write(textutils.serialize(yourTable))
fileHandle.close()