New Image (config)
Parameters:
Config: the object that contains all configuration items.
{Image: "image object", crop: "image cropping object", fill: "fill color", fillRGB: "rgb fill color. {R: 0, g: 0, B: 0} ", fillR:" r fill color ", fillG:" g fill color ", fillB: "B fill color", fillPatternImage: "fill pattern", fillPatternX: "fill pattern abscissa", fillPatternY: "fill pattern ordinate", fillPatternOffset: "fill pattern offset, you can use an array [a, B] or an object {x: a, y: B} to represent ", fillPatternOffsetX:" fill pattern x offset ", fillPatternOffsetY: "Fill pattern y offset", fillPatternScale: "fill pattern scaling volume, which can be expressed by array [a, B] or object {x: a, y: B}", fillPatternScaleX: "Fill pattern x scaling", fillPatternScaleY: "fill pattern y scaling", fillPatternRotation: "Fill pattern rotation range", fillPatternRepeat: "fill pattern tile mode, which can be repeat, repeat-x, repeat-y or no-repeat. The default value is no-repeat ", fillLinearGradientStartPoint: "fill the coordinate of the starting point of the linear gradient. You can use an array [a, B] or an object {x: a, y: B} to represent", fillLinearGradientStartPointX: "Fill linear gradient start point x coordinate", fillLinearGradientStartPointY: "fill linear gradient start point y coordinate", fillLinearGradientEndPoint: "fill linear gradient end point coordinate, you can use array [, b] or object {x: a, y: B} to represent ", fillLinearGradientEndPointX:" fill linear gradient end point x coordinate ", fillLinearGradientEndPointY: "Fill linear gradient end point y coordinate", fillLinearGradientColorStops: "fill linear gradient color position array, [a, colorA, B, colorB]", fillRadialGradientStartPoint: "fill radial gradient start point coordinate, the array [a, B] or object {x: a, y: B} can be used to represent ", fillRadialGradientStartPointX:" fill radial gradient start point x coordinate ", fillRadialGradientStartPointY: "Fill the radial gradient start point y coordinate", fillRadialGradientEndPoint: "fill the radial gradient end point coordinate, you can use an array [a, B] or object {x: a, y: b} to indicate ", fillRadialGradientEndPointX:" fill radial gradient end x coordinate ", fillRadialGradientEndPointY:" fill radial gradient end y seat ", FillRadialGradientStartRadius:" fill radial gradient start circle radius ", tip:" fill radial gradient end circle radius ", fillRadialGradientColorStops:" fill radial gradient color position array, [a, colorA, b, colorB] ", fillEnabled:" whether to enable the blob filling function. The default value is true ", fillPriority:" fill priority, fill options include color, linear-gradient, radial-gradient, and pattern. The default value is color ", stroke:" stroke color ", strokeRGB:" rgb stroke color. {R: 0, g: 0, B: 0} ", strokeR:" r stroke color ", strokeG:" g stroke color ", strokeB: "B stroke color", strokeWidth: "stroke width", strokeScaleEnabled: "whether to enable the blob stroke scaling function. The default value is true", strokeEnabled: "Whether to enable the blob stroke function. The default value is true", lineJoin: "Line Segment connection style. The connection options can be miter, round, or bevel ). The default value is miter ", lineCap:" Line Segment endpoint style. The endpoint can be butt, round, or square. The default value is butt ", shadowColor:" shadowColorRGB ", and shadowColorRGB. {R: 0, g: 0, B: 0} ", shadowColorR:" r shadow color ", shadowColorG:" g shadow color ", shadowColorB: "B shadow color", shadowBlur: "shadow blur value", shadowOffset: "fill pattern offset. You can use an array [a, B] or an object {x: a, y: b} to indicate ", shadowOffsetX:" shadow blur x offset ", shadowOffsetY:" shadow blur y offset ", shadowOpacity:" shadowtransparency, value range: 0-1 ", shadowEnabled: "Whether to enable the blob shadow function. The default value is true", dashArray: "broken number array, [Line Segment a, interval a, line segment B, interval B,...] ", dashArrayEnabled:" whether to enable the blob dash function. The default value is true. ", x:" abscissa ", y:" ordinate ", width:" width ", height: "Height", visible: "visible, true by default", listening: "whether it is in the event listening status, false by default", id: "unique identifier", name: "Name (not unique)", opacity: "blob transparency, value: 0-1", scale: "scale, you can use an array [a, B] or object {x: a, y: B} to indicate ", scaleX:" x scaling ", scaleY:" y scaling ", rotation:" rotation angle, unit: radian ", rotationDeg: "rotation angle, in the unit of angle", offset: "offset, which can be expressed by array [a, B] or object {x: a, y: B}", offsetX: "x offset", offsetY: "y offset", draggable: "whether to enable the node drag function. The default value is false.", dragBoundFunc: "drag boundfunction "}
Method:
Clear (): clears the current layer from the canvas. Currently not supported. ClearFilter (): Clear the filter. ClearImageHitRegion (): clears the image collision area. Clone (attrs): clone node, which can overwrite attributes. CreateImageHitRegion (callback): creates an image collision area. Destroy (): remove and destroy nodes. Currently not supported. DisableDashArray (): disables the broken number array. DisableFill (): Disable color filling. DisableShadow (): Disable shadow. DisableStroke (): Disable stroke. DisableStrokeScale (): Disable stroke scaling. EnableDashArray (): Enable the dash array. EnableFill (): Enable color filling. EnableShadow (): Enable shadow. EnableStroke (): Enable stroke. EnableStrokeScale (): Enable stroke scaling. Fire (eventType, evt, bubble): eventType: event type. Evt: event object. Bubble: whether to bubble, true/false. The default value is false. GetAbsoluteOpacity (): Get transparency. GetAbsolutePosition (): obtains the coordinates of the position relative to the upper left corner of the container. GetAbsoluteTransform (): Get the transformation object. GetAbsoluteZIndex (): gets a hierarchical index. GetAttr (attr) is currently not supported: Get the attribute value of the specified attribute. GetAttrs (): Get the property object. GetCanvas (): Get the canvas Renderer. Currently not supported. GetClassName (): Get type name. GetClearBeforeDraw (): determines whether the canvas is cleared before painting. GetContext (): Get the canvas context. GetCrop (): Get the cropped image object. GetDashArray (): Get the broken number array. GetDashArrayEnabled (): Gets whether the dash array is enabled. GetDragBoundFunc (): Get the boundfunction. GetDraggable (): Get the scalability. GetDrawFunc (): gets the painting function. GetDrawHitFunc (): gets the painting collision function. GetFill (): gets the fill color. GetFillB (): obtains the fill color of B. GetFillEnabled (): determines whether the fill color is enabled. GetFillG (): gets the g fill color. GetFillLinearGradientColorStops (): obtains an array of filled linear gradient color position points. GetFillLinearGradientEndPoint (): obtains the coordinates of the end point of the filled linear gradient. GetFillLinearGradientEndPointX (): obtains the abscissa of the filled linear gradient endpoint. GetFillLinearGradientEndPointY (): obtains the ordinate of the end point of the linear gradient filled with data. GetFillLinearGradientStartPoint (): obtains the ordinate of the starting point of the filled linear gradient. GetFillLinearGradientStartPointX (): obtains the abscissa of the starting point of the filled linear gradient. GetFillLinearGradientStartPointY (): obtains the ordinate of the starting point of the filled linear gradient. GetFillPatternImage (): Get the filling pattern image object. GetFillPatternOffset (): obtains the offset coordinate of the fill pattern. GetFillPatternOffsetX (): obtains the horizontal coordinate of the fill pattern offset. GetFillPatternOffsetY (): obtains the vertical coordinate of the fill pattern offset. GetFillPatternRepeat (): gets the fill pattern tile method. GetFillPatternRotation (): obtains the rotation radians of the fill pattern. GetFillPatternRotationDeg (): gets the Rotation Angle of the fill pattern. GetFillPatternScale (): gets the zoom value of the fill pattern. GetFillPatternScaleX (): obtains the horizontal scaling value of the fill pattern. GetFillPatternScaleY (): obtains the zooming value in the vertical coordinate direction of the fill pattern. GetFillPatternX (): obtains the horizontal coordinate of the fill pattern. GetFillPatternY (): obtains the ordinate of the fill pattern. GetFillPriority (): obtains the filling priority. GetFillR (): gets the r fill color. GetFillRadialGradientColorStops (): obtains the array of filled radial gradient color position points. GetFillRadialGradientEndPoint (): obtains the coordinates of the end point of the fill radial gradient. GetFillRadialGradientEndPointX (): obtains the abscissa of the end point of the fill radial gradient. GetFillRadialGradientEndPointY (): obtains the ordinate of the end point of the fill radial gradient. GetFillRadialGradientEndRadius (): obtains the radius of the end point of the fill radial gradient. GetFillRadialGradientStartPoint (): obtains the coordinates of the starting point of the fill radial gradient. GetFillRadialGradientStartPointX (): obtains the abscissa of the starting point of the fill radial gradient. GetFillRadialGradientStartPointY (): obtains the ordinate of the starting point of the fill radial gradient. GetFillRadialGradientStartRadius (): obtains the radius of the circle from the starting point of the fill radial gradient. GetFillRGB (): Get the rgb fill color literal object. GetFilter (): Get the image filter. GetFilterBrightness (): gets the brightness of the image filter. GetHeight (): Get the height. GetHitCanvas (): Get the collision canvas. GetId (): Get the id. GetLayer (): Get the layer where the node is located. GetLevel (): Get the node level. The stage level is 0, the layers level is 1, and the groups and shapes levels are> = 2. GetLineCap (): Get the endpoint style. GetLineJoin (): Get the line segment connection style. GetListening (): whether or not it is in the event listening status. GetName (): Get the name. GetOffset (): Get the offset value. GetOffsetX (): returns the x-axis offset. GetOffsetY (): obtains the y-axis offset value. GetOpacity (): Get transparency. GetParent (): Get the parent container. GetPosition (): gets the position relative to the parent node. GetRotation (): Get the rotation amplitude. GetRotationDeg (): Get the rotation angle. GetScale (): Get the scaling volume. GetScaleX (): Get the x-axis scaling. GetScaleY (): obtains the scale of the Y axis. GetShadowBlur (): obtains the shadow blur value. GetShadowColor (): gets the shadow color value. GetShadowColorB (): obtains the color value of shadow B. GetShadowColorG (): gets the g color value of the shadow. GetShadowColorR (): gets the shadow r color value. GetShadowColorRGB (): obtains the shadow rgb color value. GetShadowEnabled (): checks whether the shadow function is enabled. GetShadowOffset (): query the shadow offset value. GetShadowOffsetX (): query the Offset Value of the X axis of the shadow. GetShadowOffsetY (): query the Offset Value of the Y axis of the shadow. GetShadowOpacity (): queries the shadow transparency. GetSize (): Query size. GetSkew (): Query coordinates. GetSkewX (): query the abscissa. GetSkewY (): query the ordinate values. GetStage (): Get stage. GetStroke (): Get the stroke color. GetStroke (): Get the stroke color. GetStrokeB (): obtains the color value of stroke B. GetStrokeEnabled (): checks whether the stroke function is enabled. GetStrokeG (): gets the stroke g color value. GetStrokeR (): gets the stroke r color value. GetStrokeRGB (): obtains the rgb color value of the stroke. GetStrokeScaleEnabled (): checks whether the stroke scaling function is enabled. GetStrokeWidth (): Get the stroke width. GetTension (): Get tension. GetTransform (): Get the node transformation object. GetType (): Get the node type. GetVisible (): detects node visibility. GetWidth (): Get the node width. GetX (): obtains the abscissa of a node. GetY (): Get the ordinate of a node. GetZIndex (): Get the level relative to the sibling node. HasFill (): checks whether any padding is set. HasShadow (): checks whether shadow is set. Hide (): hides nodes. Intersects (point): checks whether a given coordinate point is in the node. IsDraggable (): checks whether nodes can be dragged. IsDraggable (): checks whether a node can be dragged. It is equivalent to getDraggable (). IsDragging (): checks whether a node is in the drag/drop mode. IsListening (): checks whether a node is currently in event listening mode, equivalent to getListening (). IsVisible (): detects node visibility, which is equivalent to getVisible (). Move (x, y): move relative to the current position of the node. MoveDown (): Move the node down. MoveTo (newContainer): Move the node to the new container. MoveToBottom (): Move the node to the bottom of its brother node. MoveToTop (): Move a node to its brother node. MoveUp (): Move up node. Off (typesStr): removes node event binding. Multiple event names are separated by spaces. You can also use namespace to remove event bindings. On (typesStr, handler): Add event binding. Multiple event names are separated by spaces. You can also bind events using namespaces. Remove (): removes a node but does not destroy it. Rotate (theta): allows the node to rotate the specified range. RotateDeg (deg): allows the node to rotate the specified angle. SetAbsolutePosition (x, y): sets the absolute position of a node. SetAttr (attr): set a single attribute of a node. SetAttrs (config): set multiple attributes of a node. SetClearBeforeDraw (clearBeforeDraw): sets whether to clear the previous painting before node re-painting. clearBeforeDraw can be set to true or false. SetCrop (config): {x: The x coordinate of the cropped image, y: The y coordinate of the cropped image, width: the width of the cropped image, and height: the height of the cropped image} setDashArray (dashArray): sets the array of broken points. SetDashArrayEnabled: sets whether to enable the dash Array Function. SetDragBoundFunc (dragBoundFunc): sets the boundfunction. SetDragBoundFunc (dragBoundFunc): sets the boundfunction. SetDraggable (draggable): sets the node's scalability. SetDrawFunc (drawFunc): sets the painting function. SetDrawHitFunc (drawHitFunc): sets the collision painting function. SetFill (color): Set the color value. SetFillB (blue): sets the B color value. SetFillEnabled (enabled): sets whether to enable color filling. SetFillG (green): sets the g color value. SetFillLinearGradientColorStops (colorStops): sets the color array of the linear gradient position. SetFillLinearGradientEndPoint (endPoint): sets the coordinate of the end point of a linear gradient. SetFillLinearGradientEndPointX (x): sets the abscissa of the linear gradient end point. SetFillLinearGradientEndPointY (y): sets the ordinate of the end point of a linear gradient. SetFillLinearGradientStartPoint (startPoint): sets the starting coordinate of the linear gradient. SetFillLinearGradientStartPointX (x): sets the abscissa of the linear gradient start point. SetFillLinearGradientStartPointY (y): sets the ordinate of the linear gradient start point. SetFillPatternImage (image): Specifies the image object of the fill pattern. SetFillPatternOffset (offset): sets the offset Value of the fill pattern. SetFillPatternOffsetX (x): sets the Offset Value of the x axis direction of the fill pattern. SetFillPatternOffsetY (y): sets the Offset Value of the y axis of the fill pattern. SetFillPatternRepeat (repeat): sets the tile mode of the fill pattern. SetFillPatternRepeat (repeat): sets the rotation radians of the fill pattern. SetFillPatternRotationDeg (rotationDeg): sets the Rotation Angle of the fill pattern. SetFillPatternScale (scale): Set the ratio of the fill pattern. SetFillPatternScaleX (x): Set the ratio of the x axis of the fill pattern. SetFillPatternScaleY (y): Set the ratio of the fill pattern to the y axis. SetFillPatternX (x): sets the horizontal coordinates of the fill pattern. SetFillPatternY (y): sets the ordinate of the fill pattern. SetFillPriority (priority): sets the filling priority. SetFillR (red): Set the fill r color value. SetFillRadialGradientColorStops (colorStops): sets the color array of the radial gradient position. SetFillRadialGradientEndPoint (endPoint): sets the coordinates of the radial gradient endpoints. SetFillRadialGradientEndPointX (x): sets the abscissa of the radial gradient end point. SetFillRadialGradientEndPointY (y): sets the ordinate of the radial gradient end point. SetFillRadialGradientEndRadius (radius): sets the radius of the end point of the radial gradient. SetFillRadialGradientStartPoint (startPoint): sets the start coordinate of the radial gradient. SetFillRadialGradientStartPointX (x): sets the abscissa of the radial gradient start point. SetFillRadialGradientStartPointY (y): sets the ordinate of the start point of the radial gradient. SetFillRadialGradientStartRadius (radius): Set the radius of the start point of the radial gradient. SetFillRGB (color): sets the rgb color value. SetHeight (height): Set the node height. SetId (id): Set the node id. SetImage (image): sets the image source object. SetLineCap (lineCap): Set the endpoint style. SetLineJoin (): Set the connection style. SetListening (listening): sets the event listening status. SetName (name): Set the node name. SetOffset (x, y): Set the node offset value. SetOffsetX (x): Set the Offset Value of the x axis of the node. SetOffsetY (y): sets the y-axis offset of the node. SetOpacity (opacity): sets the node transparency. SetPoints (can): set the path point array. SetPosition (x, y): Set the position of the node relative to the parent node. SetRotation (theta): Set the node rotation range. SetRotationDeg (deg): Set the node rotation angle. SetScale (scale): Set the node scale ratio. SetScaleX (x): Set the zooming ratio of the x axis of the node. SetScaleY (y): sets the node's y-axis scaling ratio. SetShadowBlur (blur): sets the shadow blur value. SetShadowColor (color): sets the shadow color value. SetShadowColorB (blue): sets the color of shadow B. SetShadowColorG (green): sets the g color of the shadow. SetShadowColorR (red): sets the shadow r color value. SetShadowColorRGB (color): sets the shadow rgb color value. SetShadowEnabled: sets whether to enable the shadow function. SetShadowOffset (offset): sets the shadow offset value. SetShadowOffsetX (x): sets the offset of the x axis of the shadow. SetShadowOffsetY (y): sets the offset of the Shadow y axis. SetShadowOpacity (opacity): sets the shadow transparency. SetSize (width, height): Set the node size. SetSkew (x, y): Set node coordinates. SetSkewX (x): sets the horizontal node position. SetSkewY (y): sets the vertical position of a node. SetStroke (color): sets the stroke color. SetStrokeB (blue): sets the stroke B color value. SetStrokeEnabled: sets whether to enable node stroke. SetStrokeG (green): Set the stroke g color value. SetStrokeR (red): Set the stroke r color value. SetStrokeRGB (color): sets the stroke rgb color value. SetStrokeScaleEnabled: enables/disables stroke scaling. SetStrokeWidth (strokeWidth): Set the stroke width. SetTension (tension): Set tension. SetVisible (visible): sets the node visibility. SetWidth (width): Set the node width. SetX (x): Set the x axis coordinates of the node. SetY (y): Set the y axis of the node. SetZIndex (zIndex): set the level of the node relative to the sibling node. Show (): displays nodes. StartDrag (): Start to drag. StopDrag (): Stop dragging. ToDataURL (config): creates an image data url. {Callback: "callback Function after merging", mimeType: "specifies the type of the merged image. image/png is the default type.", x: "abscissa", y: "ordinate ", width: "width", height: "height", quality: "quality of the synthesized image, 0-1"} toImage (config): merged image. {Callback: "callback Function after merging", mimeType: "specifies the type of the merged image. image/png is the default type.", x: "abscissa", y: "ordinate ", width: "width", height: "height", quality: "quality of the merged image, 0-1"} toJSON (): converts a node to a json string. ToObject (): converts a json string to a json object.