XpsCanvas
Inheritance: java.lang.Object, com.aspose.xps.XpsObject, com.aspose.xps.XpsElement, com.aspose.xps.XpsHyperlinkElement, com.aspose.xps.XpsContentElement
public final class XpsCanvas extends XpsContentElement
封装 Canvas 元素特性的类。此元素将元素组合在一起。例如,Glyphs 和 Path 元素可以在 canvas 中分组,以便被识别为一个单元(作为超链接目标),或将组合属性值应用于每个子元素和祖先元素。
方法
add(T element)
public T <T>add(T element)
向此 canvas 的子列表添加一个元素。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 元素 | T | 要添加的元素。 |
Returns: T - 已添加的元素。
insert(int index, T element)
public T <T>insert(int index, T element)
在索引位置向此 canvas 的子列表插入一个元素。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 索引 | int | 应插入元素的位置。 |
| 元素 | T | 要插入的元素。 |
Returns: T - 已插入的元素。
addCanvas()
public XpsCanvas addCanvas()
向此 canvas 的子列表添加一个新 canvas。
Returns: XpsCanvas - Added canvas.
addGlyphs(String fontFamily, float fontSize, XpsFontStyle fontStyle, float originX, float originY, String unicodeString)
public XpsGlyphs addGlyphs(String fontFamily, float fontSize, XpsFontStyle fontStyle, float originX, float originY, String unicodeString)
向此 canvas 的子列表添加新的 glyphs。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| fontFamily | java.lang.String | 字体族。 |
| fontSize | float | 字体大小。 |
| fontStyle | XpsFontStyle | 字体样式。 |
| originX | float | 字形原点 X 坐标。 |
| originY | float | Glyphs 原点的 T 坐标。 |
| unicodeString | java.lang.String | 要打印的字符串。 |
Returns: XpsGlyphs - Added glyphs.
addPath(XpsPathGeometry data)
public XpsPath addPath(XpsPathGeometry data)
向此 canvas 的子列表添加一个新 path。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| data | XpsPathGeometry | 路径的几何形状。 |
Returns: XpsPath - Added path.
deepClone()
public XpsCanvas deepClone()
克隆此 canvas。
Returns: XpsCanvas - Clone of this canvas.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| arg0 | java.lang.Object |
Returns: boolean
get(int i)
public XpsContentElement get(int i)
提供通过索引 i 访问元素子项的功能。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| i | int | 子元素的索引。 |
Returns: XpsContentElement - Child element at i position.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getClip()
public XpsPathGeometry getClip()
返回限制元素渲染区域的路径几何体。
Returns: XpsPathGeometry - The path geometry limiting the rendered region of the element.
getEdgeMode()
public XpsEdgeMode getEdgeMode()
返回控制 canvas 中路径边缘渲染方式的值。
Returns: XpsEdgeMode - The edge rendering mode.
getHyperlinkTarget()
public XpsHyperlinkTarget getHyperlinkTarget()
返回超链接目标对象。
Returns: XpsHyperlinkTarget - Hyperlink target object.
getOpacity()
public float getOpacity()
返回定义元素统一透明度的值。
Returns: float - 定义元素统一透明度的值。
getOpacityMask()
public XpsBrush getOpacityMask()
返回指定 alpha 值掩码的画刷,该掩码以与 Opacity 属性相同的方式应用于元素,但允许元素不同区域使用不同的 alpha 值。
Returns: XpsBrush - The brush specifying a mask.
getRenderTransform()
public XpsMatrix getRenderTransform()
返回仿射变换矩阵,为元素的所有属性以及所有子元素(如果有)建立新的坐标系。
Returns: XpsMatrix - The affine transformation matrix.
hashCode()
public native int hashCode()
Returns: int
insertCanvas(int index)
public XpsCanvas insertCanvas(int index)
在索引位置向此 canvas 的子列表插入一个新 canvas。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 索引 | int | 应插入新 Canvas 的位置。 |
Returns: XpsCanvas - Inserted canvas.
insertGlyphs(int index, String fontFamily, float fontSize, XpsFontStyle fontStyle, float originX, float originY, String unicodeString)
public XpsGlyphs insertGlyphs(int index, String fontFamily, float fontSize, XpsFontStyle fontStyle, float originX, float originY, String unicodeString)
在索引位置向此 canvas 的子列表插入新的 glyphs。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 索引 | int | 应插入新 Glyphs 的位置。 |
| fontFamily | java.lang.String | 字体族。 |
| fontSize | float | 字体大小。 |
| fontStyle | XpsFontStyle | 字体样式。 |
| originX | float | 字形原点 X 坐标。 |
| originY | float | Glyphs 原点的 T 坐标。 |
| unicodeString | java.lang.String | 要打印的字符串。 |
Returns: XpsGlyphs - Added glyphs.
insertPath(int index, XpsPathGeometry data)
public XpsPath insertPath(int index, XpsPathGeometry data)
在索引位置向此 canvas 的子列表插入一个新 path。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 索引 | int | 应插入新 Path 的位置。 |
| data | XpsPathGeometry | 路径的几何形状。 |
Returns: XpsPath - Inserted path.
iterator()
public Iterator<XpsContentElement> iterator()
实现 Iterable 接口。
Returns: java.util.Iterator<com.aspose.xps.XpsContentElement> - 返回列表的枚举器。
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setClip(XpsPathGeometry value)
public void setClip(XpsPathGeometry value)
设置限制元素渲染区域的路径几何体。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| value | XpsPathGeometry | 限制元素渲染区域的路径几何体。 |
setEdgeMode(XpsEdgeMode value)
public void setEdgeMode(XpsEdgeMode value)
设置控制 canvas 中路径边缘渲染方式的值。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| value | XpsEdgeMode | 边缘渲染模式。 |
setHyperlinkTarget(XpsHyperlinkTarget value)
public void setHyperlinkTarget(XpsHyperlinkTarget value)
设置超链接目标对象。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| value | XpsHyperlinkTarget | 超链接目标对象。 |
setOpacity(float value)
public void setOpacity(float value)
设置定义元素统一透明度的值。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | float | 定义元素统一透明度的值。 |
setOpacityMask(XpsBrush value)
public void setOpacityMask(XpsBrush value)
设置画刷,指定一组 alpha 值的掩码,该掩码以与 Opacity 属性相同的方式应用于元素,但允许元素的不同区域使用不同的 alpha 值。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| value | XpsBrush | 指定掩码的画刷。 |
setRenderTransform(XpsMatrix value)
public void setRenderTransform(XpsMatrix value)
设置仿射变换矩阵,为元素的所有属性以及所有子元素(如果有)建立新的坐标系。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| value | XpsMatrix | 仿射变换矩阵。 |
size()
public int size()
返回子元素的数量。
Returns: int - 子元素的数量。
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| arg0 | long | |
| arg1 | int |