This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Paint Picture?
Started by Azhf, 09 March 2013 - 09:37 AMPosted 09 March 2013 - 10:37 AM
Is there somehow a way to get the paint files from advanced computers to a picture? If so, where are the paint files found? Ex: Say I wanted to get a profile picture. I painted it on an advanced computer. How could I find that file? Thanks.
Posted 09 March 2013 - 10:40 AM
paintutils API!
Picture file:
Code to paint the picture:
The colour codes are hexidecimals (i think that's what they are :P/>)
If you need to know all of them, run this code on another advanced PC:
Picture file:
0000000000000000
1111111111111111
3333333333333333
6666666666666666
eeeeeeeeeeeeeeee
fffffffffffffffffffffffffffffff
Code to paint the picture:
local pic = paintutils.loadImage( 'imageFile' )
paintutils.drawImage( pic, 1, 1 ) -- 1, 1: x, y co-ords
The colour codes are hexidecimals (i think that's what they are :P/>)
If you need to know all of them, run this code on another advanced PC:
term.clear()
t = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}
local function hexLookup( char )
local value = tonumber(char, 16)
return (value and math.pow(2, value) or nil)
end
for i = 1, #t do
term.setBackgroundColour( hexLookup( t[i] ) )
for y = 1, 19 do
term.setCursorPos( i*3, y )
write( ' ' )
end
term.setBackgroundColour( colours.black )
term.setCursorPos( i*3+1, 9 )
write( t[i] )
end
print('\n')
Posted 09 March 2013 - 10:41 AM
O_O What? XD
Posted 09 March 2013 - 10:46 AM
This is really all you need to know that he posted.
Where 'imageFile' is the name of the image you made.
local pic = paintutils.loadImage( 'imageFile' )
paintutils.drawImage( pic, 1, 1 ) -- 1, 1: x, y co-ords
Where 'imageFile' is the name of the image you made.
Posted 09 March 2013 - 10:50 AM
What does it do? Could I have it for my desktop or something?
Posted 09 March 2013 - 10:52 AM
paintutils.loadImage() finds an image file named 'imageFile', then stores it in the variable "pic". paintutils.drawImage() draws the image file stored in the variable, pic.
So yes, you could have it for your desktop, I suppose. But when you say that, it makes me think that you're using someone else's OS, but you want to know how to customize your image for that OS. The topic is rather vague.
So yes, you could have it for your desktop, I suppose. But when you say that, it makes me think that you're using someone else's OS, but you want to know how to customize your image for that OS. The topic is rather vague.
Posted 09 March 2013 - 10:55 AM
Oh, nah, I was going to MAYBE use it for my profile pic, and for one of my topics, a logo. XDpaintutils.loadImage() finds an image file named 'imageFile', then stores it in the variable "pic". paintutils.drawImage() draws the image file stored in the variable, pic.
So yes, you could have it for your desktop, I suppose. But when you say that, it makes me think that you're using someone else's OS, but you want to know how to customize your image for that OS. The topic is rather vague.
Posted 09 March 2013 - 10:56 AM
OH, you mean for the forums?
Can't really do that without using an external tool. However, you could use a lua program to draw it using the code remiX and I gave you, then take a screenshot of it and save it as an image.
Files are stored like this:
And aren't actual images.
Can't really do that without using an external tool. However, you could use a lua program to draw it using the code remiX and I gave you, then take a screenshot of it and save it as an image.
Files are stored like this:
ab5465b
666bfea
bf0d002
And aren't actual images.
Posted 09 March 2013 - 11:02 AM
OHHH Forum Profile Picture! Lol!
Take a screenie and crop it or use the snipping tool. Save it and make it your profile picture o,o
Take a screenie and crop it or use the snipping tool. Save it and make it your profile picture o,o
Posted 09 March 2013 - 11:04 AM
Ah Lol. OkOHHH Forum Profile Picture! Lol!
Take a screenie and crop it or use the snipping tool. Save it and make it your profile picture o,o