if (imageData != null) return imageData.scaledTo(bounds.width, bounds.height);
if (imageData != null) { Scale scale = new Scale(); scale.width = bounds.width; scale.height = bounds.height; ImageData scaledImageData = (ImageData) cache.get(scale); if (scaledImageData == null) { scaledImageData = imageData.scaledTo(bounds.width, bounds.height); cache.put(scale, scaledImageData); } return scaledImageData; }
  public ImageData getBackground(Control control) {    // Give up if one of the bounds is 0.    Rectangle bounds = control.getBounds();    if (bounds.width == 0 || bounds.height == 0)      return null;        // See if this image exists.    ImageData imageData = (ImageData) control.getData(key);    if (imageData != null)      return imageData.scaledTo(bounds.width, bounds.height);        // If there's no parent composite then we don't have a parent image.    Composite parent = control.getParent();        if (parent == null)      return null;    // If the parent has no image then we bail.    ImageData parentImageData = getBackground(parent);    if (parentImageData == null)      return null;    // System.err.println("Image size = " + bounds.x + "x" + bounds.y);    imageData = new ImageData(bounds.width, bounds.height, parentImageData.depth, parentImageData.palette);    int[] data = new int[bounds.width];    for (int i = 0; i < bounds.height; i++) {      if (bounds.y + i < parentImageData.height) {        parentImageData.getPixels(bounds.x, bounds.y + i, data.length, data, 0);        imageData.setPixels(0, i, data.length, data, 0);      }    }    return imageData;  }