Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
30
Task/Bitmap/MiniScript/bitmap.mini
Normal file
30
Task/Bitmap/MiniScript/bitmap.mini
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// MiniMicro version of MiniScript has all the
|
||||
// necessary methods built-in to complete this task.
|
||||
width = 256
|
||||
height = 256
|
||||
colr = color.aqua
|
||||
|
||||
// Create the image with specified width/heigh. With
|
||||
// no parameters, it defaults width/height to 64 and
|
||||
// color to black
|
||||
img = Image.create(width, height, colr)
|
||||
|
||||
// Create a diagonal line of multiple colors. Uses
|
||||
// Cartesian coordinates so (0, 0) is lower left corner.
|
||||
for i in range(0, 255)
|
||||
img.setPixel i, i, color.rgb(i, i, i)
|
||||
end for
|
||||
|
||||
// Get pixel color as RGBA hex values
|
||||
print "Color at pixel (100, 100): " + img.pixel(100, 100)
|
||||
print "Color at pixel (0, 0): " + img.pixel(0, 0)
|
||||
print "Color at pixel (127, 127): " + img.pixel(127, 127)
|
||||
print "Color at pixel (255, 255): " + img.pixel(255, 255)
|
||||
|
||||
// Display the image, resizing it to 127 x 127
|
||||
gfx.drawImage img, 0, 0, 127, 127
|
||||
|
||||
// Save the file - accepted file extensions:
|
||||
// tga, jpg, jpeg, and png (retains transparency)
|
||||
// Optional third parameter is JPG compression quality.
|
||||
file.saveImage "/usr/test.png", img
|
||||
Loading…
Add table
Add a link
Reference in a new issue