4D v13

SVG_SET_VIEWBOX

Home

 
4D v13
SVG_SET_VIEWBOX

SVG_SET_VIEWBOX 


 

SVG_SET_VIEWBOX ( svgObject ; x ; y ; width ; height {; mode} ) 
Parameter Type   Description
svgObject  SVG_Ref in Reference of SVG element
Real in X position of viewbox
Real in Y position of viewbox
width  Real in Width of viewbox
height  Real in Height of viewbox
mode  Text in Adjustment to viewbox

The SVG_SET_VIEWBOX command can be used to specify the viewbox of the SVG object having the svgObject reference. If this attribute already exists, its value is replaced by the value passed in the parameter.

The values are expected in the user coordinate system.

The optional mode parameter can be used to indicate if the graphic must be fitted, and how so, to the size of the viewbox. The value expected for mode must be one recognized by SVG: ‘none’, ‘xMinYMin’, ‘xMidYMin’, ‘xMaxYMin’, ‘xMinYMid’, ‘xMidYMid’, ‘xMaxYMid’, ‘xMinYMax’, ‘xMidYMax’, ‘xMaxYMax’ and ‘true’ (for xMidYMid).

Example  

  `Create an SVG document of 4x8cm
 $svg:=SVG_New
 SVG_SET_DIMENSIONS($SVG;4;8;"cm")
  `Declare the user coordinate system here as 1 cm = 250 user points
 SVG_SET_VIEWBOX($svg;0;0;1000;2000;"true")

 
PROPERTIES 

Product: 4D
Theme: Attributes
Number: 65929

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: Composant 4D SVG v11.3
Modified: 4D v12

 
SEE ALSO 

SVG_SET_VIEWPORT_FILL