Class AddDimensionedImage.ConvertImageUnits

  • Enclosing class:
    AddDimensionedImage

    public static class AddDimensionedImage.ConvertImageUnits
    extends Object
    Utility methods used to convert Excels character based column and row size measurements into pixels and/or millimetres. The class also contains various constants that are required in other calculations.
    • Constructor Detail

      • ConvertImageUnits

        public ConvertImageUnits()
    • Method Detail

      • pixel2WidthUnits

        public static short pixel2WidthUnits​(int pxs)
        pixel units to excel width units(units of 1/256th of a character width)
      • widthUnits2Pixel

        public static int widthUnits2Pixel​(short widthUnits)
        excel width units(units of 1/256th of a character width) to pixel units.
      • widthUnits2Millimetres

        public static double widthUnits2Millimetres​(short widthUnits)
        Convert Excels width units into millimetres.
        Parameters:
        widthUnits - The width of the column or the height of the row in Excels units.
        Returns:
        A primitive double that contains the columns width or rows height in millimetres.
      • millimetres2WidthUnits

        public static int millimetres2WidthUnits​(double millimetres)
        Convert into millimetres Excels width units..
        Parameters:
        millimetres - A primitive double that contains the columns width or rows height in millimetres.
        Returns:
        A primitive int that contains the columns width or rows height in Excels units.