Difference between revisions of "Paintutils.loadImage"
From ComputerCraft Wiki
(kfjdgnjrtkf) |
MKlegoman357 (Talk | contribs) |
||
(9 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{lowercase}} | |
+ | {{Function | ||
+ | |name=paintutils.loadImage | ||
+ | |args={{type|string}} path | ||
+ | |api=paintutils | ||
+ | |returns={{type|table}} containing image data on success, otherwise {{type|nil}}. | ||
+ | |addon=ComputerCraft | ||
+ | |desc=Loads an image (images created with the [[Paint|paint]] program). | ||
+ | |examples= | ||
+ | {{Example | ||
+ | |desc=The program loads the image 'bar' onto the variable 'image', and then draws it on the screen, starting at position {3, 5} by using [[paintutils.drawImage]]. | ||
+ | |code= local image = '''paintutils.loadImage("bar")''' | ||
+ | [[paintutils.drawImage]](image, 3, 5) | ||
+ | }} | ||
+ | }} | ||
+ | |||
+ | [[Category:API_Functions]] |
Latest revision as of 15:51, 10 April 2014
Function paintutils.loadImage | |
Loads an image (images created with the paint program). | |
Syntax | paintutils.loadImage(string path) |
Returns | table containing image data on success, otherwise nil. |
Part of | ComputerCraft |
API | paintutils |
Examples
Example | |
The program loads the image 'bar' onto the variable 'image', and then draws it on the screen, starting at position {3, 5} by using paintutils.drawImage. | |
Code |
local image = paintutils.loadImage("bar") paintutils.drawImage(image, 3, 5) |