public abstract class CanvasAdapter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_DPI
Default dpi.
|
static float |
dpi
The dpi.
|
static Platform |
platform
The used platform.
|
static float |
textScale
The text scale.
|
static float |
userScale
The user scale.
|
| Constructor and Description |
|---|
CanvasAdapter() |
| Modifier and Type | Method and Description |
|---|---|
protected static Bitmap |
createBitmap(java.lang.String relativePathPrefix,
java.lang.String src,
int width,
int height,
int percent) |
static Bitmap |
decodeBitmap(java.io.InputStream inputStream) |
static Bitmap |
decodeBitmap(java.io.InputStream inputStream,
int width,
int height,
int percent) |
protected abstract Bitmap |
decodeBitmapImpl(java.io.InputStream inputStream)
Create
Bitmap from InputStream. |
protected abstract Bitmap |
decodeBitmapImpl(java.io.InputStream inputStream,
int width,
int height,
int percent)
Create
Bitmap from InputStream. |
static Bitmap |
decodeSvgBitmap(java.io.InputStream inputStream,
int width,
int height,
int percent) |
protected abstract Bitmap |
decodeSvgBitmapImpl(java.io.InputStream inputStream,
int width,
int height,
int percent)
Create SVG
Bitmap from InputStream. |
static java.io.File |
getAbsoluteFile(java.lang.String parentPath,
java.lang.String pathName) |
static Bitmap |
getBitmapAsset(java.lang.String relativePathPrefix,
java.lang.String src) |
static Bitmap |
getBitmapAsset(java.lang.String relativePathPrefix,
java.lang.String src,
int width,
int height,
int percent) |
static float |
getScale() |
protected static void |
init(CanvasAdapter adapter) |
protected abstract Bitmap |
loadBitmapAssetImpl(java.lang.String relativePathPrefix,
java.lang.String src,
int width,
int height,
int percent)
Create
Bitmap from bundled assets. |
static Bitmap |
newBitmap(int width,
int height,
int format) |
protected abstract Bitmap |
newBitmapImpl(int width,
int height,
int format)
Create
Bitmap with given dimensions. |
static Canvas |
newCanvas() |
protected abstract Canvas |
newCanvasImpl()
Create a Canvas.
|
static Paint |
newPaint() |
protected abstract Paint |
newPaintImpl()
Create Paint.
|
public static final float DEFAULT_DPI
public static float dpi
public static Platform platform
public static float textScale
public static float userScale
protected abstract Canvas newCanvasImpl()
public static Canvas newCanvas()
protected abstract Paint newPaintImpl()
public static Paint newPaint()
protected abstract Bitmap newBitmapImpl(int width, int height, int format)
Bitmap with given dimensions.width - the widthheight - the heightformat - the formatpublic static Bitmap newBitmap(int width, int height, int format)
protected abstract Bitmap decodeBitmapImpl(java.io.InputStream inputStream) throws java.io.IOException
Bitmap from InputStream.inputStream - the input streamjava.io.IOExceptionprotected abstract Bitmap decodeBitmapImpl(java.io.InputStream inputStream, int width, int height, int percent) throws java.io.IOException
Bitmap from InputStream.inputStream - the input streamwidth - requested width (0: no change)height - requested height (0: no change)percent - requested scale percent (100: no change)java.io.IOExceptionpublic static Bitmap decodeBitmap(java.io.InputStream inputStream) throws java.io.IOException
java.io.IOExceptionpublic static Bitmap decodeBitmap(java.io.InputStream inputStream, int width, int height, int percent) throws java.io.IOException
java.io.IOExceptionprotected abstract Bitmap decodeSvgBitmapImpl(java.io.InputStream inputStream, int width, int height, int percent) throws java.io.IOException
Bitmap from InputStream.inputStream - the input streamjava.io.IOExceptionpublic static Bitmap decodeSvgBitmap(java.io.InputStream inputStream, int width, int height, int percent) throws java.io.IOException
java.io.IOExceptionprotected abstract Bitmap loadBitmapAssetImpl(java.lang.String relativePathPrefix, java.lang.String src, int width, int height, int percent) throws java.io.IOException
Bitmap from bundled assets.relativePathPrefix - the prefix for relative resource pathsrc - the resourcejava.io.IOExceptionpublic static Bitmap getBitmapAsset(java.lang.String relativePathPrefix, java.lang.String src) throws java.io.IOException
java.io.IOExceptionpublic static Bitmap getBitmapAsset(java.lang.String relativePathPrefix, java.lang.String src, int width, int height, int percent) throws java.io.IOException
java.io.IOExceptionprotected static Bitmap createBitmap(java.lang.String relativePathPrefix, java.lang.String src, int width, int height, int percent) throws java.io.IOException
java.io.IOExceptionpublic static java.io.File getAbsoluteFile(java.lang.String parentPath,
java.lang.String pathName)
public static float getScale()
protected static void init(CanvasAdapter adapter)