bitmap -
The Bitmap class represents a 24-bit bitmap image. An instance can be constructed
by calling load or with_size:
var bm1 = new Bitmap.load(path_to_a_bmp_file)
var bm2 = new Bitmap.with_size(400, 300)
The width and height attributes contain the image's width and height, respectively.
Individual pixels can be manipulated by calling the set_pixel function:
set_pixel(x, y, color)
The no-argument grayscale function converts the bitmap to grayscale and is an implementation of this Rossetacode task: http://rosettacode.org/wiki/Grayscale_image
Finally, the bitmap can be saved to a file by calling save:
save(path_to_a_file)
For information on the bitmap format, see http://en.wikipedia.org/wiki/BMP_file_format
A module containing classes for manipulating bitmap images
Content
- bitmap (lib/bitmap)
- bitmap: The Bitmap class represents a 24-bit bitmap image. An instance can be constructed (lib/bitmap/bitmap.nit)
- test_bitmap: This file tests the Bitmap class in the bitmap module (lib/bitmap/test_bitmap.nit)