public class ImageObject extends PageObject
ImageObject
represents a PDF ImageObject in Page.
The ImageObject
class offers methods to do some operations on image object.
It can be constructed by the following way:
Example:
ImageObject imgobj = ImageObject.create(page);
TYPE_ALL, TYPE_FORMXOBJECT, TYPE_IMAGE, TYPE_PATH, TYPE_SHADING, TYPE_TEXT
Modifier and Type | Method and Description |
---|---|
static ImageObject |
create(PDFPage page)
Create an image object.
|
int |
getType()
Get type of a page object.
|
void |
setBitmap(Bitmap bitmap,
Bitmap mask)
Set a bitmap to an image object.
|
void |
setImage(Image image)
Set an image to an image object.
|
getFillColor, getHandle, getStrokeColor, release, setFillColor, setMatrix, setStrokeColor
public int getType()
PageObject
getType
in class PageObject
public static ImageObject create(PDFPage page) throws PDFException
page
- A PDFPage
object which is a PDF page. It should
be valid.ImageObject
object that receives the
image object newly created.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFPage
public void setBitmap(Bitmap bitmap, Bitmap mask) throws PDFException
bitmap
- A Bitmap
object which is a bitmap object.mask
- A Bitmap
object which is a bitmap object for
mask, and its format should be Bitmap.FORMAT_8BPP_MASK
.
This is valid only when parameter bitmap
has an
alpha channel. It can be null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Bitmap
public void setImage(Image image) throws PDFException
The ImageObject
can be set only one frame, so that
caller must call function
to load a frame of parameter Image.loadFrame(int)
Image
which is to be set.
image
- An Image
object which is a bitmap object, and it
is returned or by function Image.loadFrame(int)
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Image