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

How to put backgrounds on your monitor

Started by GurfX, 03 October 2013 - 09:16 PM
GurfX #1
Posted 03 October 2013 - 11:16 PM
I needed to know how to put a background on your monitor from one i drew in paint my paint file is called .bg
im a bit new so i dont know what information to put on no here
Just to display the backround infront of my house, no editing it
Please help!
Lyqyd #2
Posted 04 October 2013 - 01:43 AM
Split into new topic.
GurfX #3
Posted 04 October 2013 - 01:44 AM
thanks
GurfX #4
Posted 04 October 2013 - 03:20 AM
bios:337:[string "bg"]:2: '=' expected when i type monitor right bg
Lyqyd #5
Posted 04 October 2013 - 03:24 AM
Because the post you were replying to (which I have removed as useless) had no idea what they were talking about. You're going to want to use the paintutils API as well as peripheral.wrap and term.redirect to redirect the terminal to your monitor, load the image and draw it, and then restore the terminal. Check out the wiki for more information on those APIs. This is about a five line program at most, so it shouldn't be too bad. :)/>
GurfX #6
Posted 04 October 2013 - 03:24 AM
just to open the image without editing mode and display that on the monitor
GurfX #7
Posted 04 October 2013 - 07:58 PM
lyqyd i have no idea what you just said up there but i still need help
Yevano #8
Posted 04 October 2013 - 08:27 PM
Read his post. Here's his exact post in simpler terms.
  1. Load the image using paintutils.loadImage.
  2. Use term.redirect to set the current monitor.
  3. Use paintutils.drawImage to draw the loaded image.
  4. Use term.restore to restore control back to the normal monitor.
Zudo #9
Posted 05 October 2013 - 12:26 AM

local im = paintutils.loadImage('bg')
local m = peripheral.wrap('right')
term.redirect(m)
paintutils.drawImage(im, 1, 1) -- Change 1 and 1 to the co-ords of where you want the top corner of the image to be.
term.restore()

Done.