|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.jpdf.PDFObject
gnu.jpdf.PDFStream
gnu.jpdf.PDFImage
public class PDFImage
This implements the Image XObject. Calling one of the
drawImage
methods of PDFGraphics
will
put all the necessary code into the pdf file, and the image will
be encoded in ascii base 85, then deflated in zip format.
Field Summary |
---|
Fields inherited from class gnu.jpdf.PDFObject |
---|
objser, pdfDocument |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PDFImage()
Creates a new PDFImage instance. |
|
PDFImage(java.awt.Image img)
Creates a new PDFImage instance. |
|
PDFImage(java.awt.Image img,
int x,
int y,
int w,
int h,
java.awt.image.ImageObserver obs)
Creates a new PDFImage instance. |
Method Summary | |
---|---|
int |
getHeight()
Get the value of height. |
java.lang.String |
getName()
Get the name |
int |
getWidth()
Get the value of width. |
static java.lang.String |
handlePixel(int x,
int y,
int p)
Converts a pixel to a hex string |
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int w,
int h)
Describe imageUpdate method here. |
void |
setHeight(int v)
Set the value of height. |
void |
setImage(java.awt.Image img,
int x,
int y,
int w,
int h,
java.awt.image.ImageObserver obs)
Set the image |
void |
setName(java.lang.String n)
Set the name |
void |
setWidth(int v)
Set the value of width. |
void |
write(java.io.OutputStream os)
Compression needs to be improved here |
void |
writeStream(java.io.OutputStream os)
Writes the image to the stream |
Methods inherited from class gnu.jpdf.PDFStream |
---|
getDeflate, getOutputStream, getStream, getWriter, setDeflate |
Methods inherited from class gnu.jpdf.PDFObject |
---|
getPDFDocument, getSerialID, getType, toArray, toString, writeEnd, writeStart |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PDFImage()
PDFImage
instance.
public PDFImage(java.awt.Image img)
PDFImage
instance.
img
- an Image
valuepublic PDFImage(java.awt.Image img, int x, int y, int w, int h, java.awt.image.ImageObserver obs)
PDFImage
instance.
img
- an Image
valuex
- an int
valuey
- an int
valuew
- an int
valueh
- an int
valueobs
- an ImageObserver
valueMethod Detail |
---|
public int getWidth()
public void setWidth(int v)
v
- Value to assign to width.public int getHeight()
public void setHeight(int v)
v
- Value to assign to height.public void setName(java.lang.String n)
n
- a String
valuepublic java.lang.String getName()
String
valuepublic void setImage(java.awt.Image img, int x, int y, int w, int h, java.awt.image.ImageObserver obs)
img
- an Image
valuex
- an int
valuey
- an int
valuew
- an int
valueh
- an int
valueobs
- an ImageObserver
valuepublic void writeStream(java.io.OutputStream os) throws java.io.IOException
writeStream
in class PDFStream
os
- an OutputStream
value
java.io.IOException
- if an error occurspublic void write(java.io.OutputStream os) throws java.io.IOException
Compression needs to be improved here
write
in class PDFStream
os
- OutputStream to send the object to
java.io.IOException
- on errorpublic static java.lang.String handlePixel(int x, int y, int p)
Converts a pixel to a hex string
x
- an int
valuey
- an int
valuep
- an int
value
String
valuepublic boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int w, int h)
imageUpdate
method here.
imageUpdate
in interface java.awt.image.ImageObserver
img
- an Image
valueinfoflags
- an int
valuex
- an int
valuey
- an int
valuew
- an int
valueh
- an int
value
boolean
value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |