SVG_SET_VIEWBOX

4D - Documentation   Français   English   German   4D SVG Component, Command Theme List   4D SVG Component, Index   Back   Previous   Next

version 11.3


SVG_SET_VIEWBOX (svgObject; x; y; width; height{; mode})

ParameterTypeDescription
svgObjectSVG_RefReference of SVG element
xLongintX position of viewbox
yLongintY position of viewbox
widthLongintWidth of viewbox
heightLongintHeight of viewbox
modeTextAdjustment to viewbox

Description

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 1cm = 50 user points 
   SVG_SET_VIEWBOX ($svg; 0; 0; 1000; 2000; "true")

See Also

SVG_SET_VIEWPORT_FILL.


4D - Documentation   Français   English   German   4D SVG Component, Command Theme List   4D SVG Component, Index   Back   Previous   Next