4D v15SVG_Define_filter |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v15
SVG_Define_filter
|
SVG_Define_filter ( objetoSVGPadre ; id {; marcoX ; marcoX {; anchoMarco ; altoMarco {; unidadMarco ; unidadFiltro}}}} ) -> Resultado | ||||||||
Parámetro | Tipo | Descripción | ||||||
objetoSVGPadre | Ref_SVG |
![]() |
Referencia del elemento padre | |||||
id | Cadena |
![]() |
Nombre del símbolo | |||||
marcoX | Entero largo |
![]() |
Coordenada en el eje X | |||||
marcoX | Entero largo |
![]() |
Coordenada en el eje Y | |||||
anchoMarco | Entero largo |
![]() |
Ancho del rectángulo objetivo | |||||
altoMarco | Entero largo |
![]() |
Alto del rectángulo objetivo | |||||
unidadMarco | Cadena |
![]() |
Sistema de coordenadas del marco | |||||
unidadFiltro | Cadena |
![]() |
Sistema de valores del filtro | |||||
Resultado | Ref_SVG |
![]() |
Referencia del filtro | |||||
The SVG_Define_filter command sets a new filter in the SVG container designated by parentSVGObject and returns its reference. If parentSVGObject is not an SVG document, an error is generated.
A filter is a succession of graphic operations that will be applied to the target element. The filter element is never rendered directly; it will be applied to an object using the SVG_SET_FILTER command.
The id parameter specifies the name of the marker. The name will be used to associate a filter with an object. If an element with the same name exists, it will be replaced.
The optional frameX, frameY, frameWidth and frameHeight parameters set a rectangular region in the document to which this filter will be applied.
The optional frameUnit parameter sets the coordinate system for the 4 previous parameters. Expected values: "userSpaceOnUse" or "objectBoundingBox" (default value).
The optional filterUnit parameter sets the coordinate system for the lenths and the filter definition properties. Expected values: "userSpaceOnUse" (default value) or "objectBoundingBox".
In this example, we want to perform the following operations:
$Dom_SVG:=SVG_New
//creation of a rectangle with 50% blue background
$Dom_rect:=SVG_New_rect($Dom_SVG;50;50;50;50;0;0;"blue:50";"blue:50")
//creation of 4% blur filter
$Dom_filter:=SVG_Define_filter($Dom_SVG;"blur")
SVG_Filter_Blur($Dom_filter;4)
SVG_Filter_Offset($Dom_filter;4)
//application of this filter to the rectangle
SVG_SET_FILTER($Dom_rect;"blur")
//saving result in an SVG file
SVG_SAVE_AS_TEXT($Dom_SVG;System folder(Desktop)+"test.svg")
SVG_CLEAR($Dom_SVG)
Result:
SVG_Filter_Blend
SVG_Filter_Blur
SVG_Filter_Offset
SVG_SET_FILTER