Read a png from current folder

I would like to read a png or bmp from the current folder without a dialog, I know the filename.

see http://documentation.xojo.com/index.php/Picture.Open

use the example there, and replace the second line by

picFile = GetFolderItem("myfile.png", 1)

The notion of current folder depends on what you mean. Here, it is simply the folder where the application executable is. Otherwise, you must put the path in there. Or use a variable such as currentfolder = "C:\\Users\\me\\Pictures\" you put before “myfile.png”

thanks Michel,

I had to write it as picFile = GetFolderItem(“myfile.png”), without the 1

[quote=137376:@Johann JFK]thanks Michel,

I had to write it as picFile = GetFolderItem(“myfile.png”), without the 1[/quote]

The 1 tells the method it is a shell path. In Windows, it is not as necessary as on Mac.
See http://documentation.xojo.com/index.php/GetFolderItem