Package 

Class PointUtils


  • 
    public final class PointUtils
    
                        

    坐标点工具类:主要是将宽高原始坐标点到宽高变化之后目标坐标点之间进行转换

    • Method Summary

      Modifier and Type Method Description
      static Point transform(Point point, int srcWidth, int srcHeight, int destWidth, int destHeight) 转换坐标:将原始 point 的坐标点从原始:srcWidth,srcHeight 进行换算后,转换成目标:destWidth,destHeight 后的坐标点
      static Point transform(Point point, int srcWidth, int srcHeight, int destWidth, int destHeight, boolean isFit) 转换坐标:将原始 point 的坐标点从原始:srcWidth,srcHeight 进行换算后,转换成目标:destWidth,destHeight 后的坐标点
      static Point transform(int x, int y, int srcWidth, int srcHeight, int destWidth, int destHeight) 转换坐标:将原始 x,y 的坐标点从原始:srcWidth,srcHeight 进行换算后,转换成目标:destWidth,destHeight 后的坐标点
      static Point transform(int x, int y, int srcWidth, int srcHeight, int destWidth, int destHeight, boolean isFit) 转换坐标:将原始 x,y 的坐标点从原始:srcWidth,srcHeight 进行换算后,转换成目标:destWidth,destHeight 后的坐标点
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • transform

         static Point transform(Point point, int srcWidth, int srcHeight, int destWidth, int destHeight)

        转换坐标:将原始 point 的坐标点从原始:srcWidth,srcHeight 进行换算后,转换成目标:destWidth,destHeight 后的坐标点

        Parameters:
        point - 原始坐标点
        srcWidth - 原始宽度
        srcHeight - 原始高度
        destWidth - 目标宽度
        destHeight - 目标高度
      • transform

         static Point transform(Point point, int srcWidth, int srcHeight, int destWidth, int destHeight, boolean isFit)

        转换坐标:将原始 point 的坐标点从原始:srcWidth,srcHeight 进行换算后,转换成目标:destWidth,destHeight 后的坐标点

        Parameters:
        point - 原始坐标点
        srcWidth - 原始宽度
        srcHeight - 原始高度
        destWidth - 目标宽度
        destHeight - 目标高度
        isFit - 是否自适应,如果为 true 表示:宽或高自适应铺满,如果为 false 表示:填充铺满(可能会出现裁剪)
      • transform

         static Point transform(int x, int y, int srcWidth, int srcHeight, int destWidth, int destHeight)

        转换坐标:将原始 x,y 的坐标点从原始:srcWidth,srcHeight 进行换算后,转换成目标:destWidth,destHeight 后的坐标点

        Parameters:
        x - 原始X坐标
        y - 原值Y坐标
        srcWidth - 原始宽度
        srcHeight - 原始高度
        destWidth - 目标宽度
        destHeight - 目标高度
      • transform

         static Point transform(int x, int y, int srcWidth, int srcHeight, int destWidth, int destHeight, boolean isFit)

        转换坐标:将原始 x,y 的坐标点从原始:srcWidth,srcHeight 进行换算后,转换成目标:destWidth,destHeight 后的坐标点

        Parameters:
        x - 原始X坐标
        y - 原值Y坐标
        srcWidth - 原始宽度
        srcHeight - 原始高度
        destWidth - 目标宽度
        destHeight - 目标高度
        isFit - 是否自适应,如果为 true 表示:宽或高自适应铺满,如果为 false 表示:填充铺满(可能会出现裁剪)