Link Search Menu Expand Document

Form.FindSVGElement Method

Explanation Gets the SVG element displayed at the specified coordinates.

The element to get is an XmlElement object that will be part of the SVG specified in the background in the BgPattern property.
If the BgPattern property is not specified, it's impossible to get the element from an SVG that is different from the BgPattern property.

Since the display coordinates of SVG are determined in the actual display process, correct results can't be obtained even if the FindSVGElement method is called immediately after setting SVG in the BgPattern property or when SVG is never displayed on the screen such as a hidden Form.

The SVG elements to be searched are limited to the elements to be drawn such as and that have a fill color without transparency specification. For example, requires the fill attribute to be specified. If only the stroke attribute is specified and only the frame is displayed, it will not be searched.

For xPos and yPos , specify the coordinates withthe upper left of the Form(0,0).
Not supported in Mobile, AI
Call format var elm = Form1.FindSVGElement( xPos, yPos )
Return value None
Arguments integer xPos X coordinate
integer yPos Y coordinate
Exception None
Example of use
Function OnClicked(e) {
    var elm = FindSVGElement(e.xPos, e.yPos);
    if (elm == null) return;
    print(elm.TagName, "\n");
}
    
Related item BgPattern property
GetSVGElementPosition method
XmlElement class