new Pattern()
模式类
- Source:
- See:
-
- Pattern demo
- DynamicPattern demo
- fabric.Pattern#initialize for constructor definition
Members
crossOrigin :String
crossOrigin值("","anonymous", "use-credentials"之一)
Type:
- String
- Source:
- See:
offsetX :Number
图案与对象的左/上角的水平偏移量
Type:
- Number
offsetY :Number
图案与对象左/上角的垂直偏移量
Type:
- Number
patternTransform :Array
变换矩阵来改变模式,从svg导入。
Type:
- Array
repeat :String
模式的重复属性(Repeat、Repeat -x、Repeat -y或no-repeat之一)
Type:
- String
Methods
initialize(optionsopt, callbackopt) → {fabric.Pattern}
构造函数
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object |
<optional> |
选择对象 |
callback |
function |
<optional> |
回调初始化后调用的函数。 |
Returns:
thisArg
- Type
- fabric.Pattern
toLive(ctx) → {CanvasPattern}
返回CanvasPattern的一个实例
Parameters:
Name | Type | Description |
---|---|---|
ctx |
CanvasRenderingContext2D | 创建模式的上下文 |
Returns:
- Type
- CanvasPattern
toObject(propertiesToIncludeopt) → {Object}
返回模式的对象表示形式
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
propertiesToInclude |
Array |
<optional> |
您可能希望在输出中额外包含的任何属性 |
Returns:
Object representation of a pattern instance
- Type
- Object
toSVG(object) → {String}
返回模式的SVG表示形式
Parameters:
Name | Type | Description |
---|---|---|
object |
fabric.Object |
Returns:
SVG representation of a pattern
- Type
- String