public class PDFCanvas
extends java.lang.Object
Constructor and Description |
---|
PDFCanvas(PDFPage page,
com.qoppa.android.pdfProcess.util.PDFContentStream2 stream) |
Modifier and Type | Method and Description |
---|---|
void |
concatCanvasMatrix(Matrix matrix)
Concats the current matrix with the parameter.
|
void |
drawBitmap(Bitmap bitmap,
int x,
int y,
float width,
float height,
ImageParam params)
Draws a Bitmap
|
void |
drawBitmap(Bitmap bitmap,
int x,
int y,
float width,
float height,
ImageParam params,
int alpha)
Draws a Bitmap
|
void |
drawBitmap(Bitmap bitmap,
int x,
int y,
ImageParam params)
Draws a Bitmap
|
void |
drawBitmap(Bitmap bitmap,
Matrix matrix,
ImageParam params)
Draws a Bitmap, using the matrix to determine the bitmap
|
void |
drawBitmap(Bitmap bitmap,
Matrix matrix,
ImageParam params,
int alpha)
Draws a Bitmap, using the matrix to determine the bitmap
|
void |
drawCurve(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
PDFPaint paint)
Draws a bezier curve.
|
void |
drawLine(float x1,
float y1,
float x2,
float y2,
PDFPaint paint)
Draws a line.
|
void |
drawPath(PDFPath path,
PDFPaint paint)
Draws a path
|
void |
drawRect(float left,
float top,
float right,
float bottom,
PDFPaint paint)
Draws a rectangle.
|
void |
drawText(java.lang.String str,
int textColor,
float x,
float y,
PDFFont font)
Draws some text
|
Matrix |
getCanvasMatrix()
Returns the current transformation matrix.
|
void |
setCanvasMatrix(Matrix matrix)
Sets the current transformation matrix
|
public PDFCanvas(PDFPage page, com.qoppa.android.pdfProcess.util.PDFContentStream2 stream)
public void drawRect(float left, float top, float right, float bottom, PDFPaint paint)
left
- The x coordinate of the upper left corner of the rectangle.top
- The y coordinate of the upper left corner of the rectangle.right
- The x coordinate of the bottom right corner of the rectangle.bottom
- The y coordinate of the bottom right corner of the rectangle.paint
- Determines the appearance of the rectanglepublic void drawLine(float x1, float y1, float x2, float y2, PDFPaint paint)
x1
- The x coordinate of the first point of the line.y1
- The y coordinate of the first point of the line.x2
- The x coordinate of the second point of the line.y2
- The y coordinate of the second point of the line.paint
- Determines the appearance of the linepublic void drawCurve(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, PDFPaint paint)
The arc extends from point x0,y0 to point x3,y3 with control points x1,y1 and x2,y2 respectively. The color, width, and style are determined by paint.
x0
- The x coordinate of the initial point.y0
- The y coordinate of the initial point.x1
- The x coordinate of the first control point.y1
- The y coordinate of the first control point.x2
- The x coordinate of the second control point.y2
- The y coordinate of the second control point.x3
- The x coordinate of the third control point.y3
- The y coordinate of the third control point.paint
- determines the appearance of the arcpublic void drawPath(PDFPath path, PDFPaint paint)
path
- The path to be drawnpaint
- Determines the appearance of the pathpublic void drawText(java.lang.String str, int textColor, float x, float y, PDFFont font) throws PDFException
str
- The String to be drawntextColor
- The Color to use for the stringx
- The x coordinate of the point to start drawing texty
- The y coordinate of the point to start drawing textfont
- The font to use for the textPDFException
public void drawBitmap(Bitmap bitmap, int x, int y, ImageParam params) throws PDFException
bitmap
- The bitmap to drawx
- The x coordinate of the location to start the bitmapy
- The y coordinate of the location to start the bitmapparams
- Determines the compression type and quality. (may be null)PDFException
public void drawBitmap(Bitmap bitmap, int x, int y, float width, float height, ImageParam params) throws PDFException
bitmap
- The bitmap to drawx
- The x coordinate of the location to start the bitmapy
- The y coordinate of the location to start the bitmapwidth
- The destination width of the bitmapheight
- The destination width of the bitmapparams
- Determines the compression type and quality.PDFException
public void drawBitmap(Bitmap bitmap, int x, int y, float width, float height, ImageParam params, int alpha) throws PDFException
bitmap
- The bitmap to drawx
- The x coordinate of the location to start the bitmapy
- The y coordinate of the location to start the bitmapwidth
- The destination width of the bitmapheight
- The destination width of the bitmapparams
- Determines the compression type and quality.Alpha
- value from 0-255PDFException
public void drawBitmap(Bitmap bitmap, Matrix matrix, ImageParam params) throws PDFException
bitmap
- The bitmap to drawmatrix
- Translates the bitmap when drawnparams
- Determines the compression type and quality.PDFException
public void drawBitmap(Bitmap bitmap, Matrix matrix, ImageParam params, int alpha) throws PDFException
bitmap
- The bitmap to drawmatrix
- Translates the bitmap when drawnparams
- Determines the compression type and quality.Alpha
- value from 0-255PDFException
public void setCanvasMatrix(Matrix matrix)
matrix
- The new matrixpublic void concatCanvasMatrix(Matrix matrix)
matrix
- The matrix to concatpublic Matrix getCanvasMatrix()