Move/rotate/scale the element using the element ID of the SVG graphic opened in the SVG object.
void @SVGElementTransform(string classname, string elementID, float angle, float scaleX, float scaleY, float x, float y);
Parameters
string classname : The class name of SVG object
string elementID : SVG element ID
float angle : The angle to rotate with respect to the center of the original element
float scaleX : Horizontal ratio to zoom in/out based on the original element (1 : original size, 0.8 : 80% ratio, 2:200%)
float scaleY : Vertical ratio to zoom in/out based on original element (1 : Original size, 0.8 : 80% ratio, 2:200%)
float x : The distance from the center of the original element to move on the x-axis
float y : The distance to move from the center of the original element to the y-axis
Return value
none.
Example 1)
If($DI_0000 == 1)
@SVGElementTransform("SVG1", "rect", 45, 1, 1, 20, 20);
else
@SVGElementReset("SVG1", "rect");
If the DI_0000 tag is 1, in the SVG graphic of the SVG1 object, the element
with the ID rect rotates 45 degrees based on the center of the element and moves
it by 20 on the x-axis and 20 on the y-axis.
If the DI_0000 tag is 0, the
modification of the act element is initialized.
Note) If the SVG file does not have an element ID, you can open the corresponding SVG file with an editor such as a memo pad and use it by specifying the ID as below.
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200" viewBox="0 0
300 200">
<rect id="bg" width="100%"
height="100%" fill="#f0f0f0"/>
<text id="main-title"
x="150" y="50" font-family="Arial, sans-serif" font-size="24"
text-anchor="middle" fill="#333333">Main title</text>
<circle
id="circle" cx="150" cy="120" r="20" fill="#3498db"/>
<rect
id="rect" x="145" y="90" width="10" height="10"
fill="#121212"/>
<path id="curve1" d="M60,140
C90,110 120,170 150,140 S210,110 240,140" stroke="#4285f4" stroke-width="3"
fill="none"/>
</svg>
Version Infomation
Supported Version: 10.3.6.21
Related Helps)