if I need an image in my app, I drag it from finder into the app.
in the app I use it as canvas.backdrop.
if image exists, all is ok.
if the image does not exist in my app the canvas is empty.
How can I find out if the image exists in my app ?
Or is there another way how to use / store images in an app ?
Firstly I would like to know if there is a way to check for the existence
of the image in my app, I might have forgotten to drag the image into my app.
Nor me, to be fair.
But if the image is âdragged into the IDEâ, then it cant be âmissingâ by any means I can imagineâŠ
Letâs see if any more info is forthcoming
You can check if your Canvas1.Backdrop = Nil (whatever name Canvas1 isâŠ).
You can create a Picture, set some error text in it and at run time display that error Picture when the Canvas Backrop is empty ( = Nil).
That said, until nowadays and afaik, an image dropped into a project is stored in the project. That is why your project file is so large, takes time to be opened and saved.
If you export your project as xml and look at the xml, you will âseeâ the image contents (as hex, the last time I checked).
Now, this is your project and you are allowed to drop images into it (or open them using a FolderItem, once you saved them in an Images folder).
Take your time and put all images in an âImagesâ folder.
Then you load âsilentlyâ (no dialog) all the images at Open Event time.
Of course, you have to move the âImagesâ to SpecialFolder.ApplicationSupport (your folder there) at application first run time, then at each following run, you check if the folder is thereâŠ
This is exactly what Xojo is doing anyway.
Images (and other items) you drag into the IDE end up in the resources subfolder.
They are loaded silently from there , when referred to in code.
If this is Project, you can follow my previous advice to store the image outside of the projectâŠ
If this is the size of the application: nothing can be done (more or less).
The application needs the images (built-in the application or in a Support folder change nothing for the whole size).