Difference between revisions of "Image.getImage"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>Image.getImage</c> returns a rectangular portion of the image as a new image. === Arguments === {| class="wikitable" |- ! Parameter Name !! Type !! Default Value !! Mean...")
 
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<c>Image.getImage</c> returns a rectangular portion of the image as a new image.
+
<c>[[Image]].getImage</c> returns a rectangular portion of the image as a new image.
 
 
  
 
=== Arguments ===
 
=== Arguments ===
Line 20: Line 19:
  
 
<ms>img = file.loadImage("/sys/pics/Wumpus.png")
 
<ms>img = file.loadImage("/sys/pics/Wumpus.png")
// eyes = img.getImage(35, 59, 60, 48)
+
eyes = img.getImage(35, 59, 60, 48)
// view eyes</ms>
+
view eyes</ms>
  
 
[[Category:Mini Micro]]
 
[[Category:Mini Micro]]
 +
[[Category:Soda]]

Latest revision as of 04:44, 19 August 2021

Image.getImage returns a rectangular portion of the image as a new image.

Arguments

Parameter Name Type Default Value Meaning
left number 0 leftmost horizontal coordinate of the portion to get
bottom number 0 lowest vertical coordinate of the portion to get
width number image.width width (in pixels) of portion to get
height number image.height height (in pixels) of portion to get)

Example

img = file.loadImage("/sys/pics/Wumpus.png")
eyes = img.getImage(35, 59, 60, 48)
view eyes