Difference between revisions of "Image"

From MiniScript Wiki
Jump to navigation Jump to search
Line 11: Line 11:
 
| [[Image.pixel]](''x'',''y'') || get color of image pixel at ''x'',''y''
 
| [[Image.pixel]](''x'',''y'') || get color of image pixel at ''x'',''y''
 
|-
 
|-
| [[Image.setPixel]](''x'',''y'', ''c'') || set color of image pixel at ''x'',''y'' to ''c''
+
| [[Image.setPixel]] ''x'',''y'', ''c'' || set color of image pixel at ''x'',''y'' to ''c''
 
|-
 
|-
 
| [[Image.getImage]](''left'',''bottom'', ''width'', ''height'') || get a rectangular subregion of the image as a new Image
 
| [[Image.getImage]](''left'',''bottom'', ''width'', ''height'') || get a rectangular subregion of the image as a new Image

Revision as of 14:36, 9 April 2020

In Mini Micro, the Image class represents a picture, i.e. a rectangular array of pixel colors.

Method or Property Purpose
Image.width image width, in pixels
Image.height image height, in pixels
Image.pixel(x,y) get color of image pixel at x,y
Image.setPixel x,y, c set color of image pixel at x,y to c
Image.getImage(left,bottom, width, height) get a rectangular subregion of the image as a new Image