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

Putting an image on a monitor

Started by hugeblank, 12 December 2015 - 11:40 PM
hugeblank #1
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?
Bomb Bloke #2
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)
hugeblank #3
Posted 13 December 2015 - 01:10 AM
Thanks!