public static class SVGHelper.SVGLoadData
extends java.lang.Object
Constructor and Description |
---|
SVGLoadData()
use SVGHelper.noContext() to build this correctly.
|
SVGLoadData(Context context)
use SVGHelper.useContext(...) as primary option.
|
Modifier and Type | Method and Description |
---|---|
void |
bitmapAsBackground(View view)
Parses SVG with all options from context, then renders it into Drawable, and
sets it as background of the button or view.
|
SVGHelper.SVGLoadData |
checkSVGSize()
Opposite to setBaseBounds(); indicates the sizes should be
covered from <svg/> tag of the source.
|
Bitmap |
getBitmap()
Parses SVG with all options from context, then renders it into Bitmap raster image.
|
BitmapDrawable |
getBitmapDrawable()
Parses SVG with all options from context, then renders it into BitmapDrawable.
|
Picture |
getPicture()
Parses SVG with all options from context, then renders it into Picture.
|
PictureDrawable |
getPictureDrawable()
Parses SVG with all options from context, then renders it into PictureDrawable.
|
SVGHelper.SVGLoadData |
open(java.io.File file)
Indicates the source of the SVG.
|
SVGHelper.SVGLoadData |
open(int resId)
Indicates the source of the SVG.
|
SVGHelper.SVGLoadData |
open(java.lang.String svgData)
Indicates the source of the SVG.
|
SVGHelper.SVGLoadData |
open(java.net.URL url)
Indicates the source of the SVG.
|
void |
pictureAsBackground(View view)
Parses SVG with all options from context, then renders it into Drawable, and
sets it as background of the button or view.
|
SVGHelper.SVGLoadData |
registerAssetManager(AssetManager assetManager)
Redefines asset manager if it should be different from useContext() call.
|
SVGHelper.SVGLoadData |
setBaseBounds(int width,
int height)
Indicates the source SVG viewport as (0, 0, width, height).
|
SVGHelper.SVGLoadData |
setBaseHRef(java.lang.String s)
Specify base URL for relative images and fonts, if api cannot detect it automatically
|
SVGHelper.SVGLoadData |
setCropImage(boolean cropImage)
Opposite to setKeepAspectRatio(); if SVG has size 100 x 100
and you requesting 50 x 20, the final bitmap will be 50 x 20 but image will be
scaled to 50 x 50, and then cropped to 50 x 20.
|
SVGHelper.SVGLoadData |
setKeepAspectRatio(boolean keepAspectRatio)
At the scaling time, keep aspect ratio (default behavior).
|
SVGHelper.SVGLoadData |
setRequestBounds(int width,
int height)
Indicates the final bitmap size.
|
SVGHelper.SVGLoadData |
setScale(float scale)
Opposite to setRequestBounds(); indicates the size should be computed by
multiplication of the scale to base sizes (either specified in setBaseSizes() or
computed automatically by checkSVGSize() methods).
|
public SVGLoadData()
public SVGLoadData(Context context)
context
- - Context to operate with resources later.public void bitmapAsBackground(View view) throws java.io.IOException
view
- - indicates the visual element with background assigned to.java.io.IOException
public SVGHelper.SVGLoadData checkSVGSize()
public Bitmap getBitmap() throws java.io.IOException
java.io.IOException
public BitmapDrawable getBitmapDrawable() throws java.io.IOException
java.io.IOException
public Picture getPicture() throws java.io.IOException
java.io.IOException
public PictureDrawable getPictureDrawable() throws java.io.IOException
java.io.IOException
public SVGHelper.SVGLoadData open(java.io.File file) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public SVGHelper.SVGLoadData open(int resId)
public SVGHelper.SVGLoadData open(java.lang.String svgData) throws java.io.IOException
java.io.IOException
public SVGHelper.SVGLoadData open(java.net.URL url) throws java.io.IOException
java.io.IOException
public void pictureAsBackground(View view) throws java.io.IOException
view
- - View where SVG will be attached as background.java.io.IOException
public SVGHelper.SVGLoadData registerAssetManager(AssetManager assetManager)
assetManager
- public SVGHelper.SVGLoadData setBaseBounds(int width, int height)
public SVGHelper.SVGLoadData setBaseHRef(java.lang.String s)
s
- public SVGHelper.SVGLoadData setCropImage(boolean cropImage)
public SVGHelper.SVGLoadData setKeepAspectRatio(boolean keepAspectRatio)
public SVGHelper.SVGLoadData setRequestBounds(int width, int height)
public SVGHelper.SVGLoadData setScale(float scale)