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()longlonglongintlonglonglonglonglonglongbooleanvoidsetData(byte[] data) voidsetHGoalTwips(long hGoalTwips) Sets the width goal of the embedded picture in twips.voidsetImgAltAttribute(String imgAltAttribute) Sets the alternative text attribute for the image.voidsetMappingMode(int mappingMode) Sets the mapping mode for the embedded picture.voidsetOriginalHeight(long originalHeight) Sets the original height of the embedded picture.voidsetOriginalWidth(long originalWidth) Sets the original width of the embedded picture.voidsetPictureFormat(PictureFormat pictureFormat) Sets the picture format for the embedded picture.voidsetPictureUrl(String pictureUrl) Sets the picture URL for the embedded picture.voidsetScaleX(long scaleX) Sets the X scaling factor for the embedded picture.voidsetScaleY(long scaleY) Sets the Y scaling factor for the embedded picture.voidsetVisible(boolean visible) Sets the visibility of the embedded picture.voidsetWGoalTwips(long wGoalTwips) Sets the width goal of the embedded picture in twips.static inttwipsToPix(long twips) Convert TWIPS to Pixel.voidwrite(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
-