public class Renderer
extends java.lang.Object
Renderer
represents a graphics engine for rendering.
A Renderer
object is created upon a bitmap
which is like a device. If applications change properties of a renderer,
it will affect subsequent drawing results.
It can be constructed by the following way.
Example:
Size size = new Size(100, 100); Bitmap bitmap = Bitmap.create(size, FORMAT_24BPP_BGR, null, 0); Renderer render = Renderer.create(bitmap);
PDFPage
,
PDFReflowPage
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_BGRSTRIPE
Set if device is using BGR LCD stripe.
|
static int |
FLAG_GRAYSCALE
Gray scale output.
|
static int |
FLAG_LCDTEXT
Set if it needs text rendering optimized for LCD display.
|
static int |
FLAG_NONATIVETEXT
Disable native text rendering feature (like GDI+, CGContext).
|
static int |
FLAG_TEXTGAMMA
Enable gamma support to display small characters.
|
static int |
FLAG_USEANTIALIAS
Use anti-aliasing to render graphics objects.
|
Modifier and Type | Method and Description |
---|---|
static Renderer |
create(android.graphics.Bitmap bitmap)
Create a
Renderer object, from a specific Bitmap object. |
void |
drawBitmap(android.graphics.Point dstPt,
android.graphics.Bitmap srcBitmap,
android.graphics.Rect srcRect)
Render a bitmap object.
|
long |
getHandle()
Get the
Renderer handle. |
void |
release()
Release the
Renderer object. |
void |
setClipRect(android.graphics.Rect clipRect)
Set current clipping rectangle into a
Renderer object. |
void |
setDitherBits(int bits)
Set bitmap dither bits of a
Renderer object. |
void |
setFlags(int flags)
Set flags of a
Renderer object. |
static void |
setGamma(float gamma)
Set gamma value for rendering text.
|
public static final int FLAG_LCDTEXT
public static final int FLAG_BGRSTRIPE
public static final int FLAG_USEANTIALIAS
public static final int FLAG_GRAYSCALE
public static final int FLAG_NONATIVETEXT
public static final int FLAG_TEXTGAMMA
public long getHandle()
Renderer
handle.Renderer
handle.public static Renderer create(android.graphics.Bitmap bitmap) throws PDFException
Renderer
object, from a specific Bitmap
object.bitmap
- A specific Bitmap
object.Renderer
object to receive the newly created renderer.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void release() throws PDFException
Renderer
object.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setFlags(int flags) throws PDFException
Renderer
object.flags
- An integer
value for renderer flags. All undefined bits are omitted.FLAG_XXX
and
this can be one or a combination of these constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setDitherBits(int bits) throws PDFException
Renderer
object.bits
- An integer
value for number of bitmap dither bits.
It should be non-negative.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static void setGamma(float gamma) throws PDFException
Gamma value is a collation value of a picture.
gamma
- Gamma value. It should be greater than 0. Default value is
2.2.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setClipRect(android.graphics.Rect clipRect) throws PDFException
Renderer
object.clipRect
- A Rect
object which specifies a clipping
rectangle.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void drawBitmap(android.graphics.Point dstPt, android.graphics.Bitmap srcBitmap, android.graphics.Rect srcRect) throws PDFException
dstPt
- A Point
object that represents the left-top position
of the area to render in the destination coordination.srcBitmap
- A Bitmap
object which is to be rendered.srcRect
- A Rect
object which specifies a rectangle
of parameter srcBitmap
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException