Package com.scroogexhtml.pictures
Class EmbeddedPicture
java.lang.Object
com.scroogexhtml.pictures.EmbeddedPicture
- All Implemented Interfaces:
Serializable
The EmbeddedPicture class stores information about a picture in the RTF.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getData()
long
long
long
int
long
long
long
long
long
long
boolean
void
setData
(byte[] data) void
setHGoalTwips
(long hGoalTwips) Sets the width goal of the embedded picture in twips.void
setImgAltAttribute
(String imgAltAttribute) Sets the alternative text attribute for the image.void
setMappingMode
(int mappingMode) Sets the mapping mode for the embedded picture.void
setOriginalHeight
(long originalHeight) Sets the original height of the embedded picture.void
setOriginalWidth
(long originalWidth) Sets the original width of the embedded picture.void
setPictureFormat
(PictureFormat pictureFormat) Sets the picture format for the embedded picture.void
setPictureUrl
(String pictureUrl) Sets the picture URL for the embedded picture.void
setScaleX
(long scaleX) Sets the X scaling factor for the embedded picture.void
setScaleY
(long scaleY) Sets the Y scaling factor for the embedded picture.void
setVisible
(boolean visible) Sets the visibility of the embedded picture.void
setWGoalTwips
(long wGoalTwips) Sets the width goal of the embedded picture in twips.static int
twipsToPix
(long twips) Convert TWIPS to Pixel.void
write
(int value) Writes the specified byte to the picture data.
-
Constructor Details
-
EmbeddedPicture
public EmbeddedPicture()
-
-
Method Details
-
getData
public byte[] getData() -
setData
- Throws:
IOException
-
getDataStream
-
getDataLength
public long getDataLength() -
getOriginalWidth
public long getOriginalWidth() -
setOriginalWidth
public void setOriginalWidth(long originalWidth) Sets the original width of the embedded picture.- Parameters:
originalWidth
- The original width in pixels.
-
getOriginalHeight
public long getOriginalHeight() -
setOriginalHeight
public void setOriginalHeight(long originalHeight) Sets the original height of the embedded picture.- Parameters:
originalHeight
- The original height in pixels.
-
getHGoalTwips
public long getHGoalTwips() -
getWGoalTwips
public long getWGoalTwips() -
setWGoalTwips
public void setWGoalTwips(long wGoalTwips) Sets the width goal of the embedded picture in twips.- Parameters:
wGoalTwips
- The width goal of the embedded picture in twips.
-
setHGoalTwips
public void setHGoalTwips(long hGoalTwips) Sets the width goal of the embedded picture in twips.- Parameters:
hGoalTwips
- The width goal of the embedded picture in twips.
-
getScaleX
public long getScaleX() -
setScaleX
public void setScaleX(long scaleX) Sets the X scaling factor for the embedded picture.- Parameters:
scaleX
- The X scaling factor.
-
getScaleY
public long getScaleY() -
setScaleY
public void setScaleY(long scaleY) Sets the Y scaling factor for the embedded picture.- Parameters:
scaleY
- The Y scaling factor.
-
getPictureUrl
-
setPictureUrl
Sets the picture URL for the embedded picture.- Parameters:
pictureUrl
- The URL of the picture.- Throws:
NullPointerException
- if pictureUrl is null.
-
getPictureFormat
-
setPictureFormat
Sets the picture format for the embedded picture.- Parameters:
pictureFormat
- The picture format to be set.- Throws:
NullPointerException
- if pictureFormat is null.
-
getMappingMode
public int getMappingMode() -
setMappingMode
public void setMappingMode(int mappingMode) Sets the mapping mode for the embedded picture.- Parameters:
mappingMode
- The mapping mode to be set.
-
isVisible
public boolean isVisible() -
setVisible
public void setVisible(boolean visible) Sets the visibility of the embedded picture.- Parameters:
visible
- The visibility of the picture.
-
getImgAltAttribute
-
setImgAltAttribute
Sets the alternative text attribute for the image.- Parameters:
imgAltAttribute
- The alternative text attribute for the image.- Throws:
NullPointerException
- if imgAltAttribute is null.
-
getHResult
public long getHResult() -
getWResult
public long getWResult() -
twipsToPix
public static int twipsToPix(long twips) Convert TWIPS to Pixel.- Parameters:
twips
- Number of TWIPS.- Returns:
- Number of pixels.
-
write
public void write(int value) Writes the specified byte to the picture data.- Parameters:
value
- the picture data byte to be written
-