public class RtfImage extends RtfElement
Modifier and Type | Field and Description |
---|---|
private int |
alignment
The alignment of this picture
|
private float |
height
The height of this picutre
|
private byte[] |
image
The actual image.
|
private int |
imageType
The type of image this is.
|
private static byte[] |
PICTURE
Constant for a picture
|
private static byte[] |
PICTURE_BMP
Constant for a bmp image
|
private static byte[] |
PICTURE_GROUP
Constant for the shape/picture group
|
private static byte[] |
PICTURE_HEIGHT
Constant for the picture height
|
private static byte[] |
PICTURE_JPEG
Constant for a jpeg image
|
private static byte[] |
PICTURE_PNG
Constant for a png image
|
private static byte[] |
PICTURE_SCALED_HEIGHT
Constant for the picture height scale
|
private static byte[] |
PICTURE_SCALED_WIDTH
Constant for the picture width scale
|
private static byte[] |
PICTURE_WIDTH
Constant for the picture width
|
private static byte[] |
PICTURE_WMF
Constant for a wmf image
|
private float |
plainHeight
The intended display height of this picture
|
private float |
plainWidth
The intended display width of this picture
|
private boolean |
topLevelElement
Whether this RtfImage is a top level element and should
be an extra paragraph.
|
private float |
width
The width of this picture
|
document, inHeader, inTable
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR
Constructor and Description |
---|
RtfImage(RtfDocument doc,
Image image)
Constructs a RtfImage for an Image.
|
Modifier and Type | Method and Description |
---|---|
private byte[] |
getImage(Image image)
Extracts the image data from the Image.
|
void |
setAlignment(int alignment)
Sets the alignment of this RtfImage.
|
void |
setTopLevelElement(boolean topLevelElement)
Set whether this RtfImage should behave like a top level element
and enclose itself in a paragraph.
|
byte[] |
write()
Writes the RtfImage content
|
intToByteArray, isInTable, setInHeader, setInTable, setRtfDocument
private static final byte[] PICTURE_GROUP
private static final byte[] PICTURE
private static final byte[] PICTURE_JPEG
private static final byte[] PICTURE_PNG
private static final byte[] PICTURE_BMP
private static final byte[] PICTURE_WMF
private static final byte[] PICTURE_WIDTH
private static final byte[] PICTURE_HEIGHT
private static final byte[] PICTURE_SCALED_WIDTH
private static final byte[] PICTURE_SCALED_HEIGHT
private int imageType
private byte[] image
private int alignment
private float width
private float height
private float plainWidth
private float plainHeight
private boolean topLevelElement
public RtfImage(RtfDocument doc, Image image) throws DocumentException
doc
- The RtfDocument this RtfImage belongs toimage
- The Image that this RtfImage wrapsDocumentException
- If an error occured accessing the image contentprivate byte[] getImage(Image image) throws DocumentException
image
- The Image for which to extract the contentDocumentException
- If an error occurs accessing the image contentpublic byte[] write()
write
in interface RtfBasicElement
write
in class RtfElement
public void setAlignment(int alignment)
alignment
- The alignment to use.public void setTopLevelElement(boolean topLevelElement)
topLevelElement
- Whether to behave like a top level element.