Package ej.microvg

## Class BufferedVectorImage

- java.lang.Object
- - ej.microvg.VectorImage
  - - ej.microvg.ResourceVectorImage
    - - ej.microvg.BufferedVectorImage

- All Implemented Interfaces:
    `Closeable`, `AutoCloseable`

      public class BufferedVectorImage
      extends ResourceVectorImage

  A buffered vector image is a vector image that can be built dynamically.

  It reserves the format `Format.CUSTOM_7` from MicroUI.

  See Also:
    `BufferedImage`

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BufferedVectorImage​(int width, int height)` | Creates a buffered image that holds the GPU commands.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `clear()` | Clears all commands.
    `GraphicsContext` | `getGraphicsContext()` | Returns the `GraphicsContext` associated with this image, which may be used in order to draw on the image.

    - ### Methods inherited from class ej.microvg.ResourceVectorImage

      `close, isClosed, loadImage`

    - ### Methods inherited from class ej.microvg.VectorImage

      `filterImage, getDuration, getHeight, getImage, getWidth`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BufferedVectorImage

          public BufferedVectorImage​(int width,
                                     int height)

      Creates a buffered image that holds the GPU commands.

      A command is added in the image when the image's `GraphicsContext` is used to draw something into.

      Parameters:
        `width` - the width of the new image, in pixels
        `height` - the height of the new image, in pixels
      See Also:
        `BufferedImage.getGraphicsContext()`

  - ### Method Detail

    - #### getGraphicsContext

          public GraphicsContext getGraphicsContext()

      Returns the `GraphicsContext` associated with this image, which may be used in order to draw on the image.

      This method always returns the same `GraphicsContext` instance for a specific image. The graphics context has the same dimensions as the image.

      Returns:
        the image's graphics context.
      Throws:
        `MicroUIException` - if this image has been closed (see `ResourceVectorImage.close()`).

    - #### clear

          public void clear()

      Clears all commands.