Class EmbeddedPicture

java.lang.Object
com.scroogexhtml.pictures.EmbeddedPicture
All Implemented Interfaces:
Serializable

public class EmbeddedPicture extends Object implements Serializable
The EmbeddedPicture class stores information about a picture in the RTF.
See Also:
  • Constructor Details

    • EmbeddedPicture

      public EmbeddedPicture()
  • Method Details

    • getData

      public byte[] getData()
    • setData

      public void setData(byte[] data) throws IOException
      Throws:
      IOException
    • getDataStream

      public ByteArrayOutputStream 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

      public String getPictureUrl()
    • setPictureUrl

      public void setPictureUrl(String pictureUrl)
      Sets the picture URL for the embedded picture.
      Parameters:
      pictureUrl - The URL of the picture.
      Throws:
      NullPointerException - if pictureUrl is null.
    • getPictureFormat

      public PictureFormat getPictureFormat()
    • setPictureFormat

      public void setPictureFormat(PictureFormat pictureFormat)
      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

      public String getImgAltAttribute()
    • setImgAltAttribute

      public void setImgAltAttribute(String imgAltAttribute)
      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