KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Managing Images in Project Mode
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: September 27, 2021

When using Project Mode, the database is comprised of a number of "flat files" structured in folders instead of a binary file for Binary Mode. This change also impacts the picture library. The picture library does not exist in Project Mode, because the images are not stored in the database but are now individual files placed in the structured folders of the Project Mode database.

This change means that form objects referencing images cannot use a library reference any more and need to reference the path of the image. There are two main ways to store and reference images in Project Mode.

The first method is for images that will only be used for a specfic form akin to using a static image in Binary Mode. An "Images" folder can be placed in the form's folder in the following pathing pattern:

   {Project Name} > Project > Sources > Forms > {Form Name} > Images

This is also where images are stored when an image is dropped onto a form.
Images in the folder can be references by the form's object directly by using the path starting with Images:

   Images / myImage.png


The second method is the more generic method that will allow images to be referenced on multiple forms. This method more closely resembles using a picture library. Instead of storing the images in a specific directory related to a form, the images just need to be stored in the "Resources" folder either directly or in a child directory.

   {Project Name} > Resources

Or

   {Project Name} > Resources > {Folder A} > {Folder B} > ect.

Images in the picture library of a database converted to Project Mode will be placed in an Images folder located in the Resources folder.
To reference this location, the pathing can start with "RESOURCES" which must be all capitalized or else it will not reference the folder correctly.

For the following example the image is in the "Pics" folder is located in the "Resources" folder", so it can be referenced with:

   RESOURCES / Pics / myImage.png


This will allow multiple form objects from diffrent forms to reference the same image using the same path name.