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 |
scale
The scale.
|
static float |
textScale
The text 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) |
protected abstract Bitmap |
decodeBitmapImpl(java.io.InputStream inputStream)
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 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) |
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 scale
public static float textScale
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)
Bitmap from InputStream.inputStream - the input streampublic static Bitmap decodeBitmap(java.io.InputStream inputStream)
protected abstract Bitmap decodeSvgBitmapImpl(java.io.InputStream inputStream, int width, int height, int percent)
Bitmap from InputStream.inputStream - the input streampublic static Bitmap decodeSvgBitmap(java.io.InputStream inputStream, int width, int height, int percent)
protected abstract Bitmap loadBitmapAssetImpl(java.lang.String relativePathPrefix, java.lang.String src, int width, int height, int percent)
Bitmap from bundled assets.relativePathPrefix - the prefix for relative resource pathsrc - the resourcepublic static Bitmap getBitmapAsset(java.lang.String relativePathPrefix, java.lang.String src)
public static Bitmap getBitmapAsset(java.lang.String relativePathPrefix, java.lang.String src, int width, int height, int percent)
protected static Bitmap createBitmap(java.lang.String relativePathPrefix, java.lang.String src, int width, int height, int percent) throws java.io.IOException
java.io.IOExceptionprotected static void init(CanvasAdapter adapter)