Image.create

From MiniScript Wiki
Revision as of 03:19, 28 January 2021 by JoeStrout (talk | contribs) (Created page with "The <c>Image.create</c> method creates a new Image object filled with solid color. You can then add content to this image with <c>Image.setPixel</c>. === Argumen...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Image.create method creates a new Image object filled with solid color. You can then add content to this image with Image.setPixel.

Arguments

Parameter Name Type Default Value Meaning
width number 64 width of image to create, in pixels
height number 64 height of image to create, in pixels
color color "#000000" color to fill the new image

Usage Notes

This method is called on the Image class itself, rather than on a particular image instance.

Note that another way to create an image at runtime is to draw into a PixelDisplay, and then grab the image with PixelDisplay.getImage.

Example

img = Image.create(10, 10, color.red)
gfx.drawImage img, 480, 320