4D v16

SVG_New_rect

Home

 
4D v16
SVG_New_rect

SVG_New_rect 


 

SVG_New_rect ( parentSVGObject ; x ; y ; width ; height {; roundedX {; roundedY {; foregroundColor {; backgroundColor {; strokeWidth}}}}} ) -> Funktionsergebnis 
Parameter Typ   Beschreibung
parentSVGObject  SVG_Ref in Reference of parent element
Lange Ganzzahl in X of upper left corner
Lange Ganzzahl in Y of upper left corner
width  Lange Ganzzahl in Width of rectangle
height  Lange Ganzzahl in Height of rectangle
roundedX  Lange Ganzzahl in Horizontal curve
roundedY  Lange Ganzzahl in Vertical curve
foregroundColor  String in Color or gradient name
backgroundColor  String in Color or gradient name
strokeWidth  Zahl in Line thickness
Funktionsergebnis  SVG_Ref in Reference of rectangle

The SVG_New_rect command creates a new rectangle in the SVG container designated by parentSVGObject and returns its reference. If parentSVGObject is not an SVG document, an error is generated.

The rectangle is positioned and sized according to the values of x, y, width and height.

The optional roundedX and roundedY parameters can be used to round off the angles according to the indicated values. If the roundedY parameter is omitted (or is -1), the curve will be regular. Pass -1 in these parameters if you want them to be ignored by the command.

The optional foregroundColor and backgroundColor parameters contain, respectively, the name of the line color and of the background color. (For more information about colors, please refer to the commands of the Colors and Gradients theme).

The optional strokeWidth parameter contains the size of the pen expressed in pixels. Its default value is 1.

Draw a rectangle (default fill and border color, default line thickness):

 svgRef:=SVG_New
 objectRef:=SVG_New_rect(svgRef;10;10;200;100)

Draw a blue rectangle with a 3-pixel red border:

svgRef:= SVG_New
objectRef:=SVG_New_rect (svgRef;10;10;200;100;0;0;"red";"blue";3)

Draw a square with rounded edges (default fill and border color, default line thickness):

 svgRef:=SVG_New
 objectRef:=SVG_New_rect(svgRef;10;10;100;100;20)

Draw a light blue rectangle with rounded ends and a blue edge (default line thickness):

 svgRef:=SVG_New
 objectRef:=SVG_New_rect(svgRef;10;10;200;100;-1;50;"blue";"lightblue")



Siehe auch 

SVG_New_polygon
SVG_SET_ROUNDING_RECT

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: Drawing
Nummer: 65979

 
GESCHICHTE 

Geändert: Composant 4D SVG v11.4

 
ARTIKELVERWENDUNG

4D SVG ( 4D v16)