Open dialog to select image file
X-Function not designed for Auto GetN Dialog.
1. imgFile; // the image full path will be stored in system variable fname$
2. imgFile title:="String As Input";
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
image file | fname |
Output string |
|
The string that will receive path and name of the user's chosen file. |
dialog title | title |
Input string |
|
input dialog title. |
This X-Function opens a dialog to select an image file and store the file name in a string variable.
The following example shows how to pick an external image and then use insertImg2g X-Function to insert the image as the background of your graph:
if (exist(%H, 3) == 3) { // check if the current activated page is a graph window or not string strImgFullPath$; imgFile fname:=strImgFullPath$ title:="Pick Your Image"; //open a dialog to pick image. the full path of the selected file will be stored in a string variable called strImgFullPath$ insertImg2g fname:=strImgFullPath$ type:=0 xyp:=2; // insert the picked image into the current graphlayer as background }