Jump to content




Putting an image on a monitor


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

#1 hugeblank

  • Members
  • 122 posts
  • LocationA grocery store near you!

Posted 13 December 2015 - 12:40 AM

After about an hour of skimming the wiki API list to find a way to load (not edit) a paint image onto a monitor. How would I get it onto the monitor?

#2 Bomb Bloke

    Hobbyist Coder

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

Posted 13 December 2015 - 12:51 AM

paintutils.loadImage() to get the image into memory, term.redirect() to switch the default rendering device, then paintutils.drawImage() to get it onto that.

Eg:

local mon = peripheral.find("monitor")

local image = paintutils.loadImage("someImage")

local oldTerm = term.redirect(mon)

paintutils.drawImage(image, 1, 1)

term.redirect(oldTerm)


#3 hugeblank

  • Members
  • 122 posts
  • LocationA grocery store near you!

Posted 13 December 2015 - 01:10 AM

Thanks!





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users