Jump to content




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


  • You cannot reply to this topic
6 replies to this topic

#1 thewmatt

  • Members
  • 26 posts

Posted 02 September 2014 - 02: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!

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 02 September 2014 - 04:00 AM

Loaded how? From a file? How do you intend to create the image?

#3 thewmatt

  • Members
  • 26 posts

Posted 11 September 2014 - 04:00 AM

View PostBomb Bloke, on 02 September 2014 - 04:00 AM, said:

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

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 11 September 2014 - 04: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.

#5 thewmatt

  • Members
  • 26 posts

Posted 16 September 2014 - 04:03 AM

View PostLyqyd, on 11 September 2014 - 04:15 AM, said:

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! (:

#6 thewmatt

  • Members
  • 26 posts

Posted 16 September 2014 - 04:15 AM

View Postthewmatt, on 16 September 2014 - 04:03 AM, said:

View PostLyqyd, on 11 September 2014 - 04:15 AM, said:

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 by thewmatt, 16 September 2014 - 04:15 AM.


#7 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 16 September 2014 - 04:18 AM

local fileHandle = fs.open("someFile","w")
fileHandle.write(textutils.serialize(yourTable))
fileHandle.close()






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users