new Pattern()
Pattern class
模式类
- Source:
- See:
-
- Pattern demo
- DynamicPattern demo
- fabric.Pattern#initialize for constructor definition
Members
crossOrigin :String
crossOrigin value (one of "", "anonymous", "use-credentials")
crossOrigin值("","anonymous", "use-credentials"之一)
Type:
- String
- Source:
- See:
offsetX :Number
Pattern horizontal offset from object's left/top corner
图案与对象的左/上角的水平偏移量
Type:
- Number
offsetY :Number
Pattern vertical offset from object's left/top corner
图案与对象左/上角的垂直偏移量
Type:
- Number
patternTransform :Array
transform matrix to change the pattern, imported from svgs.
变换矩阵来改变模式,从svg导入。
Type:
- Array
repeat :String
Repeat property of a pattern (one of repeat, repeat-x, repeat-y or no-repeat)
模式的重复属性(Repeat、Repeat -x、Repeat -y或no-repeat之一)
Type:
- String
Methods
initialize(optionsopt, callbackopt) → {fabric.Pattern}
Constructor
构造函数
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object |
<optional> |
Options object选择对象 |
callback |
function |
<optional> |
function to invoke after callback init.回调初始化后调用的函数。 |
Returns:
thisArg
- Type
- fabric.Pattern
toLive(ctx) → {CanvasPattern}
Returns an instance of CanvasPattern
返回CanvasPattern的一个实例
Parameters:
Name | Type | Description |
---|---|---|
ctx |
CanvasRenderingContext2D | Context to create pattern创建模式的上下文 |
Returns:
- Type
- CanvasPattern
toObject(propertiesToIncludeopt) → {Object}
Returns object representation of a pattern
返回模式的对象表示形式
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
propertiesToInclude |
Array |
<optional> |
Any properties that you might want to additionally include in the output您可能希望在输出中额外包含的任何属性 |
Returns:
Object representation of a pattern instance
- Type
- Object
toSVG(object) → {String}
Returns SVG representation of a pattern
返回模式的SVG表示形式
Parameters:
Name | Type | Description |
---|---|---|
object |
fabric.Object |
Returns:
SVG representation of a pattern
- Type
- String