public class VdPreview
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
VdPreview.TargetSize
Encapsulates the information used to determine the preview image size.
|
| Constructor and Description |
|---|
VdPreview() |
| Modifier and Type | Method and Description |
|---|---|
static java.awt.image.BufferedImage |
getPreviewFromVectorDocument(VdPreview.TargetSize targetSize,
org.w3c.dom.Document xml,
java.lang.StringBuilder vdErrorLog)
This generates an image from a vector tree.
|
static java.awt.image.BufferedImage |
getPreviewFromVectorTree(VdPreview.TargetSize targetSize,
com.android.ide.common.vectordrawable.VdTree vdTree,
java.lang.StringBuilder errorLog)
Generates an image from a vector tree.
|
static java.awt.image.BufferedImage |
getPreviewFromVectorXml(VdPreview.TargetSize targetSize,
java.lang.String xmlFileContent,
java.lang.StringBuilder errorLog)
Generates an image according to the VectorDrawable's content
xmlFileContent. |
static java.lang.String |
overrideXmlContent(org.w3c.dom.Document document,
com.android.ide.common.vectordrawable.VdOverrideInfo overrideInfo,
java.lang.StringBuilder errorLog)
The UI can override some properties of the Vector drawable.
|
@Nullable
public static java.lang.String overrideXmlContent(@NonNull
org.w3c.dom.Document document,
@NonNull
com.android.ide.common.vectordrawable.VdOverrideInfo overrideInfo,
@Nullable
java.lang.StringBuilder errorLog)
document - the parsed document of original VectorDrawable's XML file.overrideInfo - incoming override information for VectorDrawable.errorLog - log for the parsing errors and warnings.@Nullable
public static java.awt.image.BufferedImage getPreviewFromVectorXml(@NonNull
VdPreview.TargetSize targetSize,
@Nullable
java.lang.String xmlFileContent,
@Nullable
java.lang.StringBuilder errorLog)
xmlFileContent.
At the same time, vdErrorLog captures all the errors found during parsing.
The size of image is determined by the size.targetSize - the size of result image.xmlFileContent - VectorDrawable's XML file's content.errorLog - log for the parsing errors and warnings.@NonNull
public static java.awt.image.BufferedImage getPreviewFromVectorDocument(@NonNull
VdPreview.TargetSize targetSize,
@NonNull
org.w3c.dom.Document xml,
@Nullable
java.lang.StringBuilder vdErrorLog)
size.targetSize - the size of result image.xml - The vector drawable XML documentvdErrorLog - log for the errors and warnings.@NonNull
public static java.awt.image.BufferedImage getPreviewFromVectorTree(@NonNull
VdPreview.TargetSize targetSize,
@NonNull
com.android.ide.common.vectordrawable.VdTree vdTree,
@Nullable
java.lang.StringBuilder errorLog)
size.targetSize - the size of result image.vdTree - The vector drawableerrorLog - log for the errors and warnings.