Class BufferedDynamicImageResource

  • All Implemented Interfaces:
    Serializable, IResource, IClusterable

    public class BufferedDynamicImageResource
    extends DynamicImageResource
    A DynamicImageResource subclass that holds a BufferedImage generated by code elsewhere. The image is held in a non-transient field, and so if this resource is clustered, the entire image will be serialized and copied. If you can regenerate your image by drawing on a Graphics2D, you should prefer the RenderedDynamicImageResource class instead since its image data is transient and therefore it is very lightweight when clustered.

    The format of the image (and therefore the resource's extension) can be specified with setFormat(String). The default format is "PNG" because JPEG is lossy and makes generated images look bad and GIF has patent issues.

    Author:
    Jonathan Locke
    See Also:
    RenderedDynamicImageResource, Serialized Form