| Package | Description |
|---|---|
| org.ofdrw.layout.edit | |
| org.ofdrw.layout.element.canvas |
| Modifier and Type | Method and Description |
|---|---|
void |
WatermarkDrawer.draw(DrawContext ctx)
绘制水印
|
| Modifier and Type | Method and Description |
|---|---|
DrawContext |
DrawContext.addFont(String name,
Path p)
添加字体至文档资源中
|
DrawContext |
DrawContext.arc(double a,
double b,
double angle,
boolean large,
boolean sweep,
double x,
double y)
从当前点连接到点(x,y)的圆弧,并将当前点移动到点(x,y)。
rx 表示椭圆的长轴长度,ry 表示椭圆的短轴长度。angle 表示
椭圆在当前坐标系下旋转的角度,正值为顺时针,负值为逆时针,
large 为 1 时表示对应度数大于180°的弧,为 0 时表示对应
度数小于 180°的弧。sweep 为 1 时表示由圆弧起始点到结束点
是顺时针旋转,为 0 时表示由圆弧起始点到结束点是逆时针旋转。
|
DrawContext |
DrawContext.arc(double x,
double y,
double r,
double sAngle,
double eAngle)
创建弧/曲线(用于创建圆或部分圆)
|
DrawContext |
DrawContext.arc(double x,
double y,
double r,
double sAngle,
double eAngle,
boolean counterclockwise)
创建弧/曲线(用于创建圆或部分圆)
|
DrawContext |
DrawContext.beginPath()
开启一段新的路径
|
DrawContext |
DrawContext.bezierCurveTo(double cp1x,
double cp1y,
double cp2x,
double cp2y,
double x,
double y)
方法三次贝塞尔曲线的指定控制点,向当前路径添加一个点。
|
DrawContext |
DrawContext.clip()
从原始画布中剪切任意形状和尺寸
|
DrawContext |
DrawContext.closePath()
关闭路径
|
DrawContext |
DrawContext.drawImage(Path img,
double dx,
double dy)
在OFD上绘制图像
|
DrawContext |
DrawContext.drawImage(Path img,
double dx,
double dy,
double dWidth,
double dHeight)
在OFD上绘制图像
|
DrawContext |
DrawContext.drawImage(Path img,
double sx,
double sy,
double sWidth,
double sHeight,
double dx,
double dy,
double dWidth,
double dHeight)
裁剪图片并在OFD上绘制图像
|
DrawContext |
DrawContext.fill()
填充已定义路径
|
DrawContext |
DrawContext.fillRect(double x,
double y,
double width,
double height)
创建并填充矩形路径
|
DrawContext |
DrawContext.fillText(String text,
double x,
double y)
填充文字
|
DrawContext |
DrawContext.lineTo(double x,
double y)
从当前点连线到指定点
|
DrawContext |
DrawContext.moveTo(double x,
double y)
移动绘制点到指定位置
|
DrawContext |
DrawContext.quadraticCurveTo(double cpx,
double cpy,
double x,
double y)
通过二次贝塞尔曲线的指定控制点,向当前路径添加一个点。
|
DrawContext |
DrawContext.rect(double x,
double y,
double width,
double height)
创建矩形路径
|
DrawContext |
DrawContext.restore()
还原绘图状态
|
DrawContext |
DrawContext.rotate(double angle)
旋转当前的绘图
|
DrawContext |
DrawContext.save()
保存当前绘图状态
|
DrawContext |
DrawContext.scale(double scalewidth,
double scaleheight)
缩放当前绘图,更大或更小
|
DrawContext |
DrawContext.setDefaultFont(double fontSize)
设置默认字体
|
DrawContext |
DrawContext.setFillColor(int[] fillColor)
设置填充颜色
|
DrawContext |
DrawContext.setFillColor(int r,
int g,
int b)
设置填充颜色
|
DrawContext |
DrawContext.setFont(FontSetting font)
设置绘制文字信息
|
DrawContext |
DrawContext.setGlobalAlpha(Double globalAlpha)
设置 绘图透明度值
|
DrawContext |
DrawContext.setLineCap(org.ofdrw.core.pageDescription.drawParam.LineCapType cap)
设置端点样式
|
DrawContext |
DrawContext.setLineDash(Double... pattern)
设置线段虚线样式
|
DrawContext |
DrawContext.setLineDash(Double dashOffset,
Double[] pattern)
设置线段虚线样式
|
DrawContext |
DrawContext.setLineJoin(org.ofdrw.core.pageDescription.drawParam.LineJoinType join)
设置线条连接样式,指定了两个线的端点结合时采用的样式。
|
DrawContext |
DrawContext.setLineWidth(double lineWidth)
获取当前线宽度
|
DrawContext |
DrawContext.setMiterLimit(Double miterLimit)
设置最大斜接长度,也就是结合点长度截断值
|
DrawContext |
DrawContext.setStrokeColor(int[] strokeColor)
设置描边颜色
|
DrawContext |
DrawContext.setStrokeColor(int r,
int g,
int b)
设置描边颜色
|
DrawContext |
DrawContext.setTextAlign(TextAlign textAlign)
设置文本对齐方式
|
DrawContext |
DrawContext.setTransform(double a,
double b,
double c,
double d,
double e,
double f)
设置变换矩阵
|
DrawContext |
DrawContext.stroke()
绘制已定义的路径
|
DrawContext |
DrawContext.strokeRect(double x,
double y,
double width,
double height)
创建并描边矩形路径
|
DrawContext |
DrawContext.transform(double a,
double b,
double c,
double d,
double e,
double f)
变换矩阵
|
DrawContext |
DrawContext.translate(double x,
double y)
重新映射画布上的 (0,0) 位置
|
| Modifier and Type | Method and Description |
|---|---|
void |
Line.draw(DrawContext ctx)
线条绘制器
|
void |
ArtWord.draw(DrawContext ctx) |
void |
Drawer.draw(DrawContext ctx)
绘制
|
void |
CellContentDrawer.draw(DrawContext ctx)
单元格内部绘制
|
Copyright © 2026. All rights reserved.