- How to?
- Managing HFSQL thumbnails
- WLanguage properties associated with the HFSQL thumbnails
- Size of control displaying the image and size of thumbnail
- Number of thumbnails
- Version 9 and earlier
To optimize the display of images in your application or in your site, you have the ability to use HFSQL thumbnails.
An HFSQL thumbnail is an image automatically generated from an image stored in an HFSQL binary memo. One or more thumbnails of different sizes can be generated for each HFSQL binary memo item.
For example, the "ProductImage" item allows you to generate two HFSQL thumbnails:
- a small thumbnail used in a Looper control,
- a larger thumbnail used in the product forms.
The thumbnail that best suits the control used to display the image will be automatically selected by the HFSQL engine.
: We advise you to display the thumbnails in a Thumbnail control (and not in an Image control).
To use the HFSQL thumbnails in Linux, the libfreetype6 library (libfreetype.so.6) must be installed on the current computer.
Managing HFSQL thumbnails
To manage the HFSQL thumbnails:
- In the data model editor, select the data file containing the HFSQL binary memo item.
- Double-click the data file to display the description of items.
- Select the desired item.
- Check "Automatic management of thumbnails" and click the "Edit" button.
- Specify the width and height (in pixels) of each thumbnail to generate.
Remark: The HFSQL thumbnails of an item are automatically generated:
WLanguage properties associated with the HFSQL thumbnails
The following WLanguage properties are used to manage HFSQL thumbnails:
|InfoThumbnailGeneration||The InfoThumbnailGeneration property is used to determine if the thumbnails of an item have been generated successfully.|
|MaxThumbnailHeight||The MaxThumbnailHeight property is used to get and change the maximum height of a thumbnail of an Image item (binary memo).|
|MaxThumbnailWidth||The MaxThumbnailWidth property is used to get or change the maximum width of a thumbnail of an Image item (binary memo).|
|NbDescribedThumbnail||The NbDescribedThumbnail property is used to get the number of thumbnails expected for an item.|
|NbThumbnail||The NbThumbnail property is used to get the number of thumbnails generated for an item.|
|Thumbnail||The Thumbnail property is used to: |
- get the value of an item thumbnail. This item was defined in the data model editor or through programming.
- get and change the image associated with a Thumbnail control.
Size of control displaying the image and size of thumbnail
The thumbnail that best suits the size of the control used to display the image will be automatically selected by the HFSQL engine.
If the size of the control used to display the image exceeds the size of the largest thumbnail, the image displayed in the control will correspond to the initial image found in the HFSQL binary memo.
Number of thumbnails
In most cases, one or two thumbnails are defined for each HFSQL binary memo. However, several thumbnails can be defined when the image is displayed in several controls of different sizes.
Remark: The larger the number of thumbnails per item is, the larger the size of the corresponding HFSQL binary memo will be.
The thumbnails are available:
- in HFSQL Classic and HFSQL Mobile mode: on the items of a data file, view or query.
- in HFSQL Client/Server mode: for the items found in a data file only.
The thumbnails are available in HFSQL Client/Server on the items of a data file.
Version 9 and earlier
The HFSQL thumbnails are not available in version 9 and earlier. Therefore, records written by an HFSQL 9 or lower engine cannot contain HFSQL thumbnails.
The table below presents the use of binary memos and thumbnails in an application in version 9 (or earlier) and in an application in version 19 that uses the same data files:
|Application (or site) in version 9 and earlier||Application (or site) in version 19|
|New record written by an HFSQL engine version 9 or earlier||Displayed image: Binary memo||Displayed image: Binary memo|
|New record written by an HFSQL engine version 10 and later||Displayed image: Binary memo||Displayed image: Thumbnail|
|Record written by an HFSQL engine version 9 (or earlier) and modified in version 19 (the value of the binary memo item is modified)||Displayed image: Binary memo||Displayed image: Thumbnail|
This page is also available for…