Class OFDPageGraphics2D

java.lang.Object
java.awt.Graphics
java.awt.Graphics2D
org.ofdrw.graphics2d.OFDPageGraphics2D

public class OFDPageGraphics2D extends Graphics2D
OFD 2D图形,实现AWT Graphics2D API。 通过图形绘制生成OFD。

在 PageGraphics2D 中所有接口参数单位均为 毫米(mm)。

Since:
2023-01-18 10:07:52
Author:
权观宇
  • Field Details

    • pageID

      public final ST_ID pageID
      页面在页树中的对象ID
  • Method Details

    • draw

      public void draw(Shape s)
      绘制图形
      Specified by:
      draw in class Graphics2D
      Parameters:
      s - 图形
    • drawString

      public void drawString(String str, int x, int y)
      使用当前的 字体(Font) 以及 画笔参数(Paint) 在指定位置上绘制文字

      文字将转换为图形路径绘制填充在OFD页面上

      第一个文字的基线坐标为传入的(x,y)参数位置。

      文字绘制的将被裁剪矩阵(clip)、变换矩阵影响。

      Specified by:
      drawString in class Graphics2D
      Parameters:
      str - 待绘制文字序列
      x - 首个文字基线X坐标
      y - 首个文字基线Y坐标
    • drawString

      public void drawString(String str, float x, float y)
      使用当前的 字体(Font) 以及 画笔参数(Paint) 在指定位置上绘制文字

      文字将转换为图形路径绘制填充在OFD页面上

      第一个文字的基线坐标为传入的(x,y)参数位置。

      文字绘制的将被裁剪矩阵(clip)、变换矩阵影响。

      Specified by:
      drawString in class Graphics2D
      Parameters:
      str - 待绘制文字序列
      x - 首个文字基线X坐标
      y - 首个文字基线Y坐标
    • drawString

      public void drawString(AttributedCharacterIterator iterator, int x, int y)
      使用迭代器绘制文字图形

      文字图形的绘制将绘制将受到画笔参数(Paint) 、被裁剪矩阵(clip)、变换矩阵影响(CTM)。

      第一个文字图形的基线坐标为传入的(x,y)参数位置。

      Specified by:
      drawString in class Graphics2D
      Parameters:
      iterator - 待绘制文本的迭代器
      x - 首个文字基线X坐标
      y - 首个文字基线Y坐标
    • drawString

      public void drawString(AttributedCharacterIterator iterator, float x, float y)
      使用迭代器绘制文字图形

      文字图形的绘制将绘制将受到画笔参数(Paint) 、被裁剪矩阵(clip)、变换矩阵影响(CTM)。

      第一个文字图形的基线坐标为传入的(x,y)参数位置。

      Specified by:
      drawString in class Graphics2D
      Parameters:
      iterator - 待绘制文本的迭代器
      x - 首个文字基线X坐标
      y - 首个文字基线Y坐标
    • drawGlyphVector

      public void drawGlyphVector(GlyphVector g, float x, float y)
      在指定位置上绘制绘制图形路径数据,

      图形的绘制将绘制将受到画笔参数(Paint) 、被裁剪矩阵(clip)、变换矩阵影响(CTM)。

      第一个文字的基线坐标为传入的(x,y)参数位置。

      Specified by:
      drawGlyphVector in class Graphics2D
      Parameters:
      g - 路径向量数据
      x - 图形绘制位置X坐标
      y - 图形绘制位置Y坐标
    • drawImage

      public boolean drawImage(Image img, int x, int y, ImageObserver observer)
      在指定坐标位置上绘制图片

      绘制的图片大小为图元原始大小

      Specified by:
      drawImage in class Graphics
      Parameters:
      img - 待绘制图片
      x - 图片左上角 X坐标
      y - 图片左上角 Y坐标
      observer - 不使用
      Returns:
      固定值 true
    • drawImage

      public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
      将图片绘制于指定矩形区域内
      Specified by:
      drawImage in class Graphics
      Parameters:
      img - 待绘制的图片
      x - 矩形左上角 X坐标
      y - 矩形左上角 Y坐标
      width - 矩形宽度
      height - 矩形高度
      observer - 忽略
      Returns:
      固定值 true
    • drawImage

      public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
      在指定位置绘制图片

      图片保持原有大小,图片的透明部分将会使用指定颜色填充

      Specified by:
      drawImage in class Graphics
      Parameters:
      img - 待绘制的图片
      x - 矩形左上角 X坐标
      y - 矩形左上角 Y坐标
      bgcolor - 背景颜色,用于填充图片透明部分
      observer - 忽略
      Returns:
      固定值 true
    • drawImage

      public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
      在指定矩形区域内绘制图片

      图片将伸缩至矩形区域大小,图片的透明部分将会使用指定颜色填充

      Specified by:
      drawImage in class Graphics
      Parameters:
      img - 待绘制的图片
      x - 矩形左上角 X坐标
      y - 矩形左上角 Y坐标
      width - 矩形宽度
      height - 矩形高度
      bgcolor - 背景颜色,用于填充图片透明部分
      observer - 忽略
      Returns:
      固定值 true
    • drawImage

      public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
      绘制图片内某个矩形区域 到 画布的某个指定矩形区域,图片将会缩放适应目标区域
      Specified by:
      drawImage in class Graphics
      Parameters:
      img - 待绘制图片
      dx1 - 画布内 矩形左上角 X坐标(目的坐标)
      dy1 - 画布内 矩形左上角 Y坐标(目的坐标)
      dx2 - 画布内 矩形右下角 X坐标(目的坐标)
      dy2 - 画布内 矩形右下角 Y坐标(目的坐标)
      sx1 - 图片内 矩形左上角 X坐标(源坐标)
      sy1 - 图片内 矩形左上角 Y坐标(源坐标)
      sx2 - 图片内 矩形右下角 X坐标(源坐标)
      sy2 - 图片内 矩形右下角 Y坐标(源坐标)
      observer - 忽略
      Returns:
      固定值 true
    • drawImage

      public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
      绘制图片内某个矩形区域 到 画布的某个指定矩形区域

      图片将会缩放适应目标区域,图片的透明部分将会使用指定颜色填充

      Specified by:
      drawImage in class Graphics
      Parameters:
      img - 待绘制图片
      dx1 - 画布内 矩形左上角 X坐标(目的坐标)
      dy1 - 画布内 矩形左上角 Y坐标(目的坐标)
      dx2 - 画布内 矩形右下角 X坐标(目的坐标)
      dy2 - 画布内 矩形右下角 Y坐标(目的坐标)
      sx1 - 图片内 矩形左上角 X坐标(源坐标)
      sy1 - 图片内 矩形左上角 Y坐标(源坐标)
      sx2 - 图片内 矩形右下角 X坐标(源坐标)
      sy2 - 图片内 矩形右下角 Y坐标(源坐标)
      bgcolor - 背景颜色,用于填充透明部分
      observer - 忽略
      Returns:
      固定值 true
    • drawImage

      public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
      通过变换矩阵在指定位置绘制图像
      Specified by:
      drawImage in class Graphics2D
      Parameters:
      img - 待绘制的图像(可渲染图像接口)
      xform - 变换矩阵,指定图像绘制方式
      obs - 忽略
      Returns:
      true
    • drawImage

      public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
      在画布指定位置绘制图像,在绘制前将会使用 BufferedImageOp 过滤图像

      等价于

            img1 = op.filter(img, null);
            drawImage(img1, new AffineTransform(1f,0f,0f,1f,x,y), null);
      
      Specified by:
      drawImage in class Graphics2D
      Parameters:
      img - 待绘制图像
      op - 图片渲染前的过滤器
      x - 图片左上角X坐标
      y - 图片左上角Y坐标
    • drawRenderedImage

      public void drawRenderedImage(RenderedImage img, AffineTransform xform)
      通过变换矩阵在指定位置绘制图像
      Specified by:
      drawRenderedImage in class Graphics2D
      Parameters:
      img - 待绘制的图像(可渲染图像接口)
      xform - 变换矩阵,指定图像绘制方式
    • drawRenderableImage

      public void drawRenderableImage(RenderableImage img, AffineTransform xform)
      通过变换矩阵在指定位置绘制图像
      Specified by:
      drawRenderableImage in class Graphics2D
      Parameters:
      img - 待绘制的图像(可渲染图像接口)
      xform - 变换矩阵,指定图像绘制方式
    • fill

      public void fill(Shape s)
      填充图形
      Specified by:
      fill in class Graphics2D
      Parameters:
      s - Java图形
    • hit

      public boolean hit(Rectangle rect, Shape s, boolean onStroke)
      检查在设备空间内容 指定的矩形区域是否与 指定形状存在交集。

      onStroke 为false,表示检查指定形状整体是否与指定矩形相交。

      onStroke 为true,表示检查指定形状的描边整体是否与指定矩形相交。

      Specified by:
      hit in class Graphics2D
      Parameters:
      rect - 矩形区域
      s - 待检查的图形形状
      onStroke - 相交检查方式,true - 描边区域是否相交; false - 整个形状是否相交
      Returns:
      true - 相交;false - 不相交
    • getDeviceConfiguration

      public GraphicsConfiguration getDeviceConfiguration()
      获取设备图形配置对象
      Specified by:
      getDeviceConfiguration in class Graphics2D
      Returns:
      OFD页面虚拟图形配置对象
    • setComposite

      public void setComposite(Composite comp)
      设置像素合成模式

      该方法原用于在设备绘制图像时,当前绘制的像素与原位置上已经存在的像素颜色的合成方式。 OFD中没有对应的合成效果,仅做兼容性实现。

      Specified by:
      setComposite in class Graphics2D
      Parameters:
      comp - 合成方式
    • setPaint

      public void setPaint(Paint paint)
      设置绘制参数
      Specified by:
      setPaint in class Graphics2D
      Parameters:
      paint - 设置画笔颜色,用于填充和描边
    • setStroke

      public void setStroke(Stroke s)
      设置描边属性
      Specified by:
      setStroke in class Graphics2D
      Parameters:
      s - 描边属性参数
    • setRenderingHint

      public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
      设置绘制器参数
      Specified by:
      setRenderingHint in class Graphics2D
      Parameters:
      hintKey - 参数名
      hintValue - 参数值
    • getRenderingHint

      public Object getRenderingHint(RenderingHints.Key hintKey)
      获取绘制器参数值(为了兼容接口,无实际用途)
      Specified by:
      getRenderingHint in class Graphics2D
      Parameters:
      hintKey - 参数名
      Returns:
      可能为空
    • setRenderingHints

      public void setRenderingHints(Map<?,?> hints)
      替换绘制器参数(为了兼容接口,无实际用途)
      Specified by:
      setRenderingHints in class Graphics2D
      Parameters:
      hints - 新参数
    • addRenderingHints

      public void addRenderingHints(Map<?,?> hints)
      添加绘制器参数(为了兼容接口,无实际用途)
      Specified by:
      addRenderingHints in class Graphics2D
      Parameters:
      hints - 键值对
    • getRenderingHints

      public RenderingHints getRenderingHints()
      获取当前绘制器参数信息(为了兼容接口,无实际用途)
      Specified by:
      getRenderingHints in class Graphics2D
      Returns:
      参数信息(只读)
    • create

      public Graphics create()
      复制当前绘制上下文为新的上下文
      Specified by:
      create in class Graphics
      Returns:
      复制的绘制上下文对象
    • getColor

      public Color getColor()
      返回前景色
      Specified by:
      getColor in class Graphics
      Returns:
      颜色,可能为null
    • setColor

      public void setColor(Color c)
      设置前景色
      Specified by:
      setColor in class Graphics
      Parameters:
      c - 颜色
    • setPaintMode

      public void setPaintMode()
      setPaintMode 不实现
      Specified by:
      setPaintMode in class Graphics
    • setXORMode

      public void setXORMode(Color c1)
      setXORMode 不实现
      Specified by:
      setXORMode in class Graphics
      Parameters:
      c1 - the XOR alternation color
    • getFont

      public Font getFont()
      获取当前字体
      Specified by:
      getFont in class Graphics
      Returns:
      字体
    • setFont

      public void setFont(Font font)
      设置绘图上下文的字体
      Specified by:
      setFont in class Graphics
      Parameters:
      font - 字体
    • getFontMetrics

      public FontMetrics getFontMetrics(Font f)
      获取特定字体的字体规格
      Specified by:
      getFontMetrics in class Graphics
      Parameters:
      f - 特定字体
      Returns:
      字体规格
    • getClipBounds

      public Rectangle getClipBounds()
      获取裁剪区域的外接矩形大小
      Specified by:
      getClipBounds in class Graphics
      Returns:
      裁剪区域外接矩形,可能为null
    • clipRect

      public void clipRect(int x, int y, int width, int height)
      设置矩形裁剪区域
      Specified by:
      clipRect in class Graphics
      Parameters:
      x - 裁剪矩形区域X坐标
      y - 裁剪矩形区域Y坐标
      width - 裁剪矩形矩形宽度
      height - 裁剪矩形矩形高度
    • setClip

      public void setClip(int x, int y, int width, int height)
      设置矩形裁剪区域

      若已经存在裁剪区域那么旧的裁剪区域将会被新的裁剪区域覆盖

      Specified by:
      setClip in class Graphics
      Parameters:
      x - 裁剪矩形区域X坐标
      y - 裁剪矩形区域Y坐标
      width - 裁剪矩形矩形宽度
      height - 裁剪矩形矩形高度
    • getClip

      public Shape getClip()
      获取裁剪区域
      Specified by:
      getClip in class Graphics
      Returns:
      裁剪区域,可能为null
    • clip

      public void clip(Shape s)
      设置裁剪区域

      若已经存在裁剪区域,那么新的裁剪区域与旧的裁剪区域取交集。

      Specified by:
      clip in class Graphics2D
      Parameters:
      s - 裁剪区域,如果为 null 则清除裁剪区域
    • setClip

      public void setClip(Shape s)
      设置裁剪区域

      若已经存在裁剪区域那么旧的裁剪区域将会被新的裁剪区域覆盖

      Specified by:
      setClip in class Graphics
      Parameters:
      s - 裁剪区域,为null时表示清空裁剪区域
    • copyArea

      public void copyArea(int x, int y, int width, int height, int dx, int dy)
      复制矩形区域
      Specified by:
      copyArea in class Graphics
      Parameters:
      x - the x coordinate of the source rectangle.
      y - the y coordinate of the source rectangle.
      width - the width of the source rectangle.
      height - the height of the source rectangle.
      dx - the horizontal distance to copy the pixels.
      dy - the vertical distance to copy the pixels.
    • drawLine

      public void drawLine(int x1, int y1, int x2, int y2)
      画线
      Specified by:
      drawLine in class Graphics
      Parameters:
      x1 - 起点X
      y1 - 起点Y
      x2 - 终点X
      y2 - 终点Y
    • fillRect

      public void fillRect(int x, int y, int width, int height)
      填充矩形区域
      Specified by:
      fillRect in class Graphics
      Parameters:
      x - 矩形区域左上角坐标X
      y - 矩形区域左上角坐标Y
      width - 矩形宽度
      height - 矩形高度
    • drawRect

      public void drawRect(int x, int y, int width, int height)
      描边矩形
      Overrides:
      drawRect in class Graphics
      Parameters:
      x - 矩形区域左上角坐标X
      y - 矩形区域左上角坐标Y
      width - 矩形宽度
      height - 矩形高度
    • clearRect

      public void clearRect(int x, int y, int width, int height)
      使用背景色填充矩形区域
      Specified by:
      clearRect in class Graphics
      Parameters:
      x - 填充区域矩形左上角 X 坐标
      y - 填充区域矩形左上角 X 坐标
      width - 矩形宽度
      height - 矩形高度
    • drawRoundRect

      public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
      绘制圆角矩形
      Specified by:
      drawRoundRect in class Graphics
      Parameters:
      x - 矩形左上角X坐标
      y - 矩形左上角Y坐标
      width - 矩形宽度
      height - 矩形高度
      arcWidth - 水平圆角半径
      arcHeight - 垂直圆角半径
    • fillRoundRect

      public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
      填充圆角矩形
      Specified by:
      fillRoundRect in class Graphics
      Parameters:
      x - 矩形左上角X坐标
      y - 矩形左上角Y坐标
      width - 矩形宽度
      height - 矩形高度
      arcWidth - 水平圆角半径
      arcHeight - 垂直圆角半径
    • drawOval

      public void drawOval(int x, int y, int width, int height)
      使用当前颜色在矩形区域内描边椭圆形
      Specified by:
      drawOval in class Graphics
      Parameters:
      x - 矩形区域左上角 X 坐标
      y - 矩形区域左上角 Y 坐标
      width - 矩形区域宽度
      height - 矩形区域高度
    • fillOval

      public void fillOval(int x, int y, int width, int height)
      使用当前颜色在矩形区域内填充椭圆形
      Specified by:
      fillOval in class Graphics
      Parameters:
      x - 矩形区域左上角 X 坐标
      y - 矩形区域左上角 Y 坐标
      width - 矩形区域宽度
      height - 矩形区域高度
    • drawArc

      public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
      在矩形区域内绘制圆弧

      注意:0度位于时钟3点钟位置,正数角度表示顺时针旋转,负数为逆时针,圆形位于矩形中心。

      Specified by:
      drawArc in class Graphics
      Parameters:
      x - 矩形区域左上角 X 坐标
      y - 矩形区域左上角 Y 坐标
      width - 矩形区域宽度
      height - 矩形区域高度
      startAngle - 圆弧开始角度
      arcAngle - 圆弧结束角度
    • fillArc

      public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
      在矩形区域内填充扇形

      注意:0度位于时钟3点钟位置,正数角度表示顺时针旋转,负数为逆时针,圆形位于矩形中心。

      圆弧起点和终点为圆心

      Specified by:
      fillArc in class Graphics
      Parameters:
      x - 矩形区域左上角 X 坐标
      y - 矩形区域左上角 Y 坐标
      width - 矩形区域宽度
      height - 矩形区域高度
      startAngle - 圆弧开始角度
      arcAngle - 圆弧结束角度
    • drawPolyline

      public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
      绘制折线

      注意绘制的折线是一个不闭合的图形

      Specified by:
      drawPolyline in class Graphics
      Parameters:
      xPoints - 折点 X坐标 序列
      yPoints - 折点 Y坐标 序列
      nPoints - 折点总数
    • drawPolygon

      public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
      使用当前颜色和描边属性描边多边形
      Specified by:
      drawPolygon in class Graphics
      Parameters:
      xPoints - 多边形 X坐标 序列
      yPoints - 多边形 Y坐标 序列
      nPoints - 多边形点数量
    • fillPolygon

      public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
      使用当前颜色填充多边形
      Specified by:
      fillPolygon in class Graphics
      Parameters:
      xPoints - 多边形 X坐标 序列
      yPoints - 多边形 Y坐标 序列
      nPoints - 多边形点数量
    • translate

      public void translate(int x, int y)
      平移原点坐标
      Specified by:
      translate in class Graphics2D
      Parameters:
      x - x方向的平移距离
      y - y方向的平移距离
    • translate

      public void translate(double tx, double ty)
      平移原点
      Specified by:
      translate in class Graphics2D
      Parameters:
      tx - x方向的平移距离
      ty - y方向的平移距离
    • rotate

      public void rotate(double theta)
      绕原点旋转画布
      Specified by:
      rotate in class Graphics2D
      Parameters:
      theta - 旋转角度,计算方式为 theta = angle * Math.PI / 180 ,负数表示逆时针。
    • rotate

      public void rotate(double theta, double x, double y)
      绕指定点旋转画布

      等价于

               translate(x, y);
               rotate(theta);
               translate(-x, -y);
      
      Specified by:
      rotate in class Graphics2D
      Parameters:
      theta - 旋转角度,计算方式为 theta = angle * Math.PI / 180 ,负数表示逆时针。
      x - 旋转点X坐标
      y - 旋转点Y坐标
    • scale

      public void scale(double sx, double sy)
      坐标缩放
      Specified by:
      scale in class Graphics2D
      Parameters:
      sx - 缩放当前绘图的宽度 (1=100%, 0.5=50%, 2=200%, 依次类推)
      sy - 缩放当前绘图的高度 (1=100%, 0.5=50%, 2=200%, 依次类推)
    • shear

      public void shear(double shx, double shy)
      切变
      Specified by:
      shear in class Graphics2D
      Parameters:
      shx - X方向切变角度
      shy - Y方向切变角度
    • transform

      public void transform(AffineTransform tx)
      图形变换
      Specified by:
      transform in class Graphics2D
      Parameters:
      tx - 变换矩阵
    • setTransform

      public void setTransform(AffineTransform tx)
      设置变换矩阵
      Specified by:
      setTransform in class Graphics2D
      Parameters:
      tx - 变换矩阵
    • getTransform

      public AffineTransform getTransform()
      返回当前的变换矩阵
      Specified by:
      getTransform in class Graphics2D
      Returns:
      变换矩阵
    • getPaint

      public Paint getPaint()
      获取绘制参数
      Specified by:
      getPaint in class Graphics2D
      Returns:
      绘制参数
    • getComposite

      public Composite getComposite()
      获取像素合成模式

      该属性只是为了兼容AWT接口保留,并无实际用途。

      Specified by:
      getComposite in class Graphics2D
      Returns:
      获取像素合成模式
    • setBackground

      public void setBackground(Color color)
      设置背景颜色
      Specified by:
      setBackground in class Graphics2D
      Parameters:
      color - 该颜色将用于 clearRect 清空区域
    • getBackground

      public Color getBackground()
      获取背景颜色
      Specified by:
      getBackground in class Graphics2D
      Returns:
      背景颜色
    • getStroke

      public Stroke getStroke()
      获取描边属性
      Specified by:
      getStroke in class Graphics2D
      Returns:
      描述属性 BasicStroke
    • getFontRenderContext

      public FontRenderContext getFontRenderContext()
      获取绘制上下文中的字体绘制上下文
      Specified by:
      getFontRenderContext in class Graphics2D
      Returns:
      字体绘制上下文
    • dispose

      public void dispose()
      销毁绘制上下文
      Specified by:
      dispose in class Graphics
    • appendPageBlock

      public void appendPageBlock(PageBlockType block)
      在当前页面内容容器(CT_PageBlock)尾部追加一个页块对象

      供其他绘制管线(如 PDF 转换的文字对象输出)按内容流顺序追加

      invalid reference
      TextObject
      等图元, 保证与 fill(Shape)、draw(Shape) 产生的路径对象在 z-order 上严格一致。 追加操作不受当前绘制属性(画笔、描边、变换矩阵)影响,调用方负责自行给出图元的坐标与属性。
      Parameters:
      block - 待追加的页块对象,为 null 时忽略
    • newObjectId

      public ST_ID newObjectId()
      生成页面所在文档内的新对象 ID

      供通过 appendPageBlock(PageBlockType) 追加图元的调用方分配对象 ID, 与 fill/draw/drawImage 生成的图元共用同一套 ID 空间。

      Returns:
      文档内唯一的新对象 ID
    • getOfdDir

      public OFDDir getOfdDir()
      取得当前页所属的文档工作目录

      供需要写入页面注释(如 Annots/)等非页面内容资源的调用方使用; 文档打包时整目录入包,因此写入该目录下的文件会随文档一起输出。

      Returns:
      文档工作目录
    • getDocument

      public Document getDocument()
      取得当前页所属文档对象

      供调用方登记文档级条目(例如 Annotations 注释索引)。

      Returns:
      文档对象
    • addImageResource

      public ST_ID addImageResource(BufferedImage image) throws IOException
      把位图登记为文档图片资源

      供需要引用图片资源但又不直接绘制图片的调用方使用(例如水印单元缩略图)。

      Parameters:
      image - 位图(非空)
      Returns:
      图片资源 ID
      Throws:
      IOException - 编码或写盘失败
    • trans

      public ST_Array trans(AffineTransform tx)
      转为AWT变换矩阵 AffineTransform 为 OFD 类型变换矩阵ST_Array
      Parameters:
      tx - AWT变换矩阵
      Returns:
      OFD ST_Array