类 ImageUtils

java.lang.Object
org.nutz.img.Images
club.zhcs.lina.utils.ImageUtils

public class ImageUtils extends org.nutz.img.Images
作者:
Kerbores(kerbores@riemann.tech)
  • 嵌套类概要

    嵌套类
    修饰符和类型
    类
    说明
    static class 
    坐标点
  • 字段概要

    从类继承的字段 org.nutz.img.Images

    CHANNEL_BLUE, CHANNEL_GREEN, CHANNEL_RED, WATERMARK_BOTTOM_CENTER, WATERMARK_BOTTOM_LEFT, WATERMARK_BOTTOM_RIGHT, WATERMARK_CENTER, WATERMARK_CENTER_LEFT, WATERMARK_CENTER_RIGHT, WATERMARK_TOP_CENTER, WATERMARK_TOP_LEFT, WATERMARK_TOP_RIGHT
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static org.nutz.lang.util.NutMap
    baiduOcr(String path, String key)
     
    static File
    generateImage(String imgStr, File outFile)
     
    static File
    generateImage(String imgStr, File outDir, String suffix)
    根据base64串生成文件
    static File
    生成png图片
    static String
    getImageStr(File imgFile)
    图片转换成base64串
    static File
    将 BufferedImage 写入文件
    zoomAndClip(File src, double scale, int xStart, int yStart, int xEnd, int yEnd)
    图片缩放裁剪
    zoomAndClip(File src, double scale, ImageUtils.Point start, int w, int h)
     
    zoomAndClip(File src, double scale, ImageUtils.Point start, ImageUtils.Point end)
     

    从类继承的方法 org.nutz.img.Images

    addWatermark, channelImage, clipScale, clipScale, clipScale, clipScale, clipScale, clipScale, createAvatar, createAvatar, createCaptcha, createCaptcha, createText, createText, cutoutByChannel, cutoutByLuminance, cutoutByPixel, encodeBase64, encodeBase64, flipHorizontal, flipHorizontal, flipVertical, flipVertical, grayImage, multiply, read, redraw, rotate, rotate, rotate, scale, twist, write, write, writeAndClose, writeJpeg, zoomScale, zoomScale, zoomScale, zoomScale

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • ImageUtils

      public ImageUtils()
  • 方法详细资料

    • zoomAndClip

      public static BufferedImage zoomAndClip(File src, double scale, int xStart, int yStart, int xEnd, int yEnd) throws IOException
      图片缩放裁剪
      参数:
      src - 源图
      scale - 缩放比例
      xStart - 起点X坐标
      yStart - 起点Y坐标
      xEnd - 终点X坐标
      yEnd - 终点Y坐标
      返回:
      目标图片
      抛出:
      IOException - 当读写文件失败时抛出
    • zoomAndClip

      public static BufferedImage zoomAndClip(File src, double scale, ImageUtils.Point start, ImageUtils.Point end) throws IOException
      抛出:
      IOException
    • toFile

      public static File toFile(BufferedImage bfi)
      将 BufferedImage 写入文件
      参数:
      bfi - BufferedImage图像
      返回:
      写入的文件对象
    • zoomAndClip

      public static BufferedImage zoomAndClip(File src, double scale, ImageUtils.Point start, int w, int h) throws IOException
      抛出:
      IOException
    • generateImage

      public static File generateImage(String imgStr, File outFile)
      参数:
      imgStr - 图片数据
      outFile - 输出文件
      返回:
      文件
    • generateImage

      public static File generateImage(String imgStr, File outDir, String suffix)
      根据base64串生成文件
      参数:
      imgStr - base64串
      outDir - 输出目录
      suffix - 扩展名
      返回:
      文件
    • generatePngImage

      public static File generatePngImage(String imgStr)
      生成png图片
      参数:
      imgStr - base64 image信息串
      返回:
      图片文件
    • getImageStr

      public static String getImageStr(File imgFile)
      图片转换成base64串
      参数:
      imgFile - 图片文件
      返回:
      base64 图片信息串
    • baiduOcr

      public static org.nutz.lang.util.NutMap baiduOcr(String path, String key)