Difference between revisions of "PixelDisplay.getImage"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>PixelDisplay.getImage</c> returns a portion of the pixel display as an Image. === Arguments === {| class="wikitable" |- ! Parameter Name !! Type !! Default Value !! M...")
 
m (fixed typo)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<c>PixelDisplay.getImage</c> returns a portion of the pixel display as an [[Image]].
+
<c>[[PixelDisplay]].getImage</c> returns a portion of the pixel display as an [[Image]].
  
 
=== Arguments ===
 
=== Arguments ===
Line 18: Line 18:
 
=== Usage Notes ===
 
=== Usage Notes ===
 
Note that this works even for a display that is not visible (because it is covered by another
 
Note that this works even for a display that is not visible (because it is covered by another
display, or has been turned [[DisplayMode|off]].  This allows you to use
+
display, or has been turned [[DisplayMode|off]]).  This allows you to use
 
a PixelDisplay as an area to create images at runtime, using any combination
 
a PixelDisplay as an area to create images at runtime, using any combination
 
of drawing methods, and then capture the result for use as a [[Sprite]], or
 
of drawing methods, and then capture the result for use as a [[Sprite]], or
 
to [[File.saveImage|save]] to disk, etc.
 
to [[File.saveImage|save]] to disk, etc.
 +
 +
Another way to create an [[Image]] at runtime is to use [[Image.create]].
  
 
[[Category:Mini Micro]]
 
[[Category:Mini Micro]]

Latest revision as of 15:18, 29 January 2025

PixelDisplay.getImage returns a portion of the pixel display as an Image.

Arguments

Parameter Name Type Default Value Meaning
left number 0 left side of display area to get
bottom number 0 bottom side of display area to get
width number 960 width side of display area to get
height number 640 height side of display area to get

Usage Notes

Note that this works even for a display that is not visible (because it is covered by another display, or has been turned off). This allows you to use a PixelDisplay as an area to create images at runtime, using any combination of drawing methods, and then capture the result for use as a Sprite, or to save to disk, etc.

Another way to create an Image at runtime is to use Image.create.