You are here: irt.org | FAQ | Java | Q4004 [ previous next ]
MemoryImageSource is an image producer class that creates a new Image object from an array of integers, the most common syntax (constructor) is:
MemoryImageSource(int width, int height, int pixel[], int offset, int scanLineWidth)
For Example if we have an array of 64 integers called pixels and we want to create an 8x8 Image we would write:
img = CreateImage(new MemoryImageSource(8, 8, pixels, 0, 8));