How to display my images in a Notes view
II2LN has a powerful feature that let you import images and make them visible directly in the Notes views. Below you see a snapshot of this;
The snapshot above shows imported images directly in the Notes views! How do you do that ?
- Use the function ImportImageAsResource to import and prepare the image for display in Notes views.
- The ImportImageAsResource function will automatically create a set of extra fields in the Notes document. These fields are prefixed with the fieldname you specified as thumbnail-fieldname. If that was "XYZ", you will have these three extra fields;
- XYZFilename - the filename of the Image Resource itself.
- XYZWidth - the width of the thumbnail in pixels
- XYZHeight - the height of the thumbnail in pixels
- II2LN will also automatically create a rich text field ("XYZ" in our scenario) and establish the reference to the image resource.
- Create a standard Notes view.
- Ensure that your view properties has the Height set to 9 lines, and that you have checked the "Shrink rows to content"
This enables our view to show images taller than one line!
- Determine where you want your thumbnail to be displayed. In the snapshot below, the thumbnail is in the first column:
- Create a column that is wide enough to display your thumbnail
- The formula for your column is the field name you specified as the thumbnail-field name. In our example it would have been "XYZ".
- Make the column display it's value as icons
- Add another "height adjuster column". This is just a column that will add some empty spaces so we gain enough room for our image. The column can typically be the last column -unless- you make a categorized view. Then this column has to be just in front of the thumbnail column.
To have a formula add some space for you, you can for example use this formula:
REM {Ensure the row is high enough};
n := @Round (ThumbnailHeight / 40 +0,5);
s := @Repeat(" @"; n);
@Explode(s; "@")
Note that the field ThumbnailHeight represents the autogenerated field with the thumbnail prefix above! In our scenario this field would have the fieldname "XYZHeight".
- In order to make Notes refresh properly and thus display your imported image in the view, add the following LotusScript code after the ImportImageAsResource-call:
Dim ws As New NotesUIWorkspace
Call ws.ViewRefresh
Call ws.ReloadWindow