Difference between revisions of "Paintutils.loadImage"
From ComputerCraft Wiki
(Created page with " Paintutils.loadImage returns an image object == Usage == <code> foo = paintutils.loadImage("bar") -- Loads image "bar" as "foo"<br/> paintutils.drawImage(bar, 1, 1) -- Draws...") |
MKlegoman357 (Talk | contribs) |
||
| (17 intermediate revisions by 7 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
| 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
| 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)
|