MemoryImageSource

Class MemoryImageSource

All Implemented Interfaces:
ImageProducer
public class MemoryImageSource
extends Object
implements ImageProducer

This class is an implementation of the ImageProducer interface which uses an array to produce pixel values for an Image. Here is an example which calculates a 100x100 image representing a fade from black to blue along the X axis and a fade from black to red along the Y axis:

int w = 100;
      int h = 100;
      int pix[] = new int[w * h];
      int index = 0;
      for (int y = 0; y < h; y++) {
          int red = (y * 255) / (h - 1);
          for (int x