Class BinaryPartAbstractImage.CxCy

java.lang.Object
org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage.CxCy
Enclosing class:
BinaryPartAbstractImage

public static class BinaryPartAbstractImage.CxCy extends Object
  • Field Details

    • EMU_RATIO

      private static final int EMU_RATIO
      See Also:
    • cx

      long cx
    • cy

      long cy
    • scaled

      boolean scaled
  • Constructor Details

    • CxCy

      CxCy(long cx, long cy, boolean scaled)
  • Method Details

    • getCx

      public long getCx()
      Returns:
      the resulting cx
    • getCy

      public long getCy()
      Returns:
      the resulting cy
    • isScaled

      public boolean isScaled()
      Returns:
      whether it was necessary to scale the image to fit the page width
    • scale

      public static BinaryPartAbstractImage.CxCy scale(org.apache.xmlgraphics.image.loader.ImageInfo imageInfo, PageDimensions page)
    • scale

      public static BinaryPartAbstractImage.CxCy scale(org.apache.xmlgraphics.image.loader.ImageInfo imageInfo, PageDimensions page, int maxWidth)
      Return scaling values constrained by specified maxWidth. Useful if the image is to be inserted into a table cell of known width.
      Parameters:
      imageInfo -
      page -
      maxWidth -
      Returns:
      Since:
      3.3.0
    • scale

      public static BinaryPartAbstractImage.CxCy scale(org.apache.xmlgraphics.image.loader.ImageInfo imageInfo, Presentation.SldSz sldSz)
    • toEmu

      private static double toEmu(double widthPx, double dpi)
    • scale

      public static BinaryPartAbstractImage.CxCy scale(org.apache.xmlgraphics.image.loader.ImageInfo imageInfo, double xEmu, double yEmu)
    • scaleToFit

      public static BinaryPartAbstractImage.CxCy scaleToFit(double iwEmu, double ihEmu, double swEmu, double shEmu)
      Parameters:
      iwEmu - image width in EMU
      ihEmu - image height in EMU
      swEmu - slide width in EMU
      shEmu - slide height in EMU
      Returns: