Package ej.microvg
Class ResourceVectorImage
- java.lang.Object
-
- ej.microvg.VectorImage
-
- ej.microvg.ResourceVectorImage
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
BufferedVectorImage
public class ResourceVectorImage extends VectorImage implements Closeable
Represents a vector image which requires dynamic allocation in order to be created.A resource vector image must be closed in order to free the dynamic allocation used to store the image data.
-
-
Constructor Summary
Constructors Constructor Description ResourceVectorImage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this vector image and its associated resources.booleanisClosed()Returns whether this vector image has been closed or not.static ResourceVectorImageloadImage(String resourcePath)Loads a vector image from a path.-
Methods inherited from class ej.microvg.VectorImage
filterImage, getDuration, getHeight, getImage, getWidth
-
-
-
-
Method Detail
-
isClosed
public boolean isClosed()
Returns whether this vector image has been closed or not.- Returns:
trueif the vector image has been closed,falseotherwise.
-
close
public void close()
Closes this vector image and its associated resources.Calling this method on a vector image which has already been closed has no effect.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
loadImage
public static ResourceVectorImage loadImage(String resourcePath)
Loads a vector image from a path.This method can load images which are in the internal image format defined by the MicroVG implementation. The caller is responsible for calling
close()on the returned image when it is no longer used.- Parameters:
resourcePath- the path to get the image from- Returns:
- a vector image
- Throws:
VectorGraphicsException- if the image could not be retrieved for any reason (seeVectorGraphicsException.getErrorCode())- Since:
- 1.2
-
-