|
|
|
|
|
- Finding out the display mode and the alignment mode of an image (syntax 1)
- Limitations
ImageMode (Property) In french: ImageMode
The ImageMode property is used to get and change: - the display mode of an image,
- the alignment of image,
- the HQ mode of image.
This property can be used: - for an Image control,
- for an Image table column,
- for the background of a Chart control found in a window,
- for a Button control.
Remark: The display mode of an image is defined under the window or page editor in the field description ("General" tab). For example: | | | Normal image | Centered image | Stretched image | Homothetic centered image | Tiled image | |
IMG_ImageVoiture.ImageMode = imgTiled
IMG_ImageVoiture.ImageMode = imgNormal + imgAlignVBottom
IMG_ImageVoiture.ImageMode = IMG_ImageVoiture.ImageMode + imgNoScale
Syntax
Finding out the display mode and the alignment mode of an image Hide the details
<Current mode> = <Control used>.ImageMode
<Current mode>: Integer constant (or combination of constants) - Current image display mode:
| | imgCentered | Centered: Image centered in the control.
| imgH | Homothetic: Image enlarged or reduced while respecting the proportions of the initial image to be entirely displayed in the control.
| imgHC | Homothetic centered: Image enlarged or reduced while respecting the proportions of the initial image to be entirely displayed in the control and centered in the control.
| imgHCE | Homothetic extended centered: Image enlarged or reduced in size, respecting the proportions of the original image, so that the smaller side of the image is displayed entirely in the field and the image is centered in the field..
| imgHCWIS | Homothetic without increasing size: If the image can be entirely displayed in the control, it is displayed at 100% and centered in the control. Otherwise, it is downsized, while maintaining its aspect ratio to fit and appear centered in the control. This constant is not available. | imgHE | Homothetic extended: Image enlarged or reduced while respecting the proportions of the initial image in order for the smallest side of the image to be entirely displayed in the control.
| imgHWIS | Homothetic without increasing size: If the image can be entirely displayed in the control, it is displayed at 100%. Otherwise, it is downsized, while maintaining its aspect ratio to fit the control. This constant is not available. | imgNormal | 100%: Image displayed at 100% in the upper-left corner of the control.
| imgStretched | Stretched: Image stretched to occupy the entire surface of the control.
| imgTiled | Tiled: Image displayed at 100% and tiled to occupy the entire surface of the control.
|
- Alignment mode of the image:
| | imgAlignHCentered | Horizontally centered.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. | imgAlignHRight | Horizontal alignment to right.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. | imgAlignVBottom | Bottom vertical alignment.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. | imgAlignVCentered | Vertically centered.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. |
- Management of image quality:
| | imgHQ | In homothetic mode, improves the image quality when it is downsized.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. |
- Management of large fonts:
| | imgNoScale | In "Large fonts" mode of Windows, the image displayed in an Image control is automatically zoomed. The imgNoScale constant allows you not to zoom the image in "Large fonts" mode. This constant is useful for drawing in controls that contain a bitmap screenshot. This constant must be combined with one of the constants used to define the display mode of image. ![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. |
<Control used>: Control name Name of the control to be used.
Modifying the display mode and the alignment mode of an image Hide the details
<Control used>.ImageMode = <New mode>
<Control used>: Control name Name of the control to be used. <New mode>: Integer constant - New display mode for the image:
| | imgCentered | Centered: Image centered in the control.
| imgH | Homothetic: Image enlarged or reduced while respecting the proportions of the initial image to be entirely displayed in the control.
| imgHC | Homothetic centered: Image enlarged or reduced while respecting the proportions of the initial image to be entirely displayed in the control and centered in the control.
| imgHCE | Homothetic extended centered: Image enlarged or reduced in size, respecting the proportions of the original image, so that the smaller side of the image is displayed entirely in the field and the image is centered in the field..
| imgHCWIS | Homothetic without increasing size: If the image can be entirely displayed in the control, it is displayed at 100% and centered in the control. Otherwise, it is downsized, while maintaining its aspect ratio to fit and appear centered in the control. This constant is not available. | imgHE | Homothetic extended: Image enlarged or reduced while respecting the proportions of the initial image in order for the smallest side of the image to be entirely displayed in the control.
| imgHWIS | Homothetic without increasing size: If the image can be entirely displayed in the control, it is displayed at 100%. Otherwise, it is downsized, while maintaining its aspect ratio to fit the control. This constant is not available. | imgNormal | 100%: Image displayed at 100% in the upper-left corner of the control.
| imgStretched | Stretched: Image stretched to occupy the entire surface of the control.
| imgTiled | Tiled: Image displayed at 100% and tiled to occupy the entire surface of the control.
|
- Alignment mode of the image:
| | imgAlignHCentered | Horizontally centered.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. | imgAlignHRight | Horizontal alignment to right.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. | imgAlignVBottom | Bottom vertical alignment.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. | imgAlignVCentered | Vertically centered.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. |
- Management of image quality:
| | imgHQ | In homothetic mode, improves the image quality when it is downsized.![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. |
- Management of large fonts:
| | imgNoScale | In "Large fonts" mode of Windows, the image displayed in an Image control is automatically zoomed. The imgNoScale constant allows you not to zoom the image in "Large fonts" mode. This constant is useful for drawing in controls that contain a bitmap screenshot. This constant must be combined with one of the constants used to define the display mode of image. ![WEBDEV - Server code WEBDEV - Server code](https://doc.pcsoft.fr/ext/images/us/WBS.png?-1123132264) ![Android Android](https://doc.pcsoft.fr/ext/images/us/ANDROID.png?385929803) This constant is not available. |
Remarks Finding out the display mode and the alignment mode of an image (syntax 1) The ImageMode property returns a single value representing both the image display and alignment mode. To separate the alignment information from the display information, a binary filter must be applied in order to subtract the display mask or the alignment mask from the result ( BitwiseAND). Tip: If you wish to retrieve only the value corresponding to the alignment mode, apply a binary mask whose value is the sum of all alignment constants.. The remaining constant will be the alignment constant used in the image. For example: ModeActuel is int
MasqueModeAlignement is int
ModeAlignement is int
ModeActuel = IMG_Photo.ImageMode
MasqueModeAlignement = imgAlignHCentered + imgAlignHRight + imgAlignVBottom + imgAlignVCentered
ModeAlignement = BitwiseAND(ModeActuel, MasqueModeAlignement)
Info(ModeAlignement)
Limitations The ImageMode property applies only to: - Image controls,
- Image columns in Table controls,
- Chart controls in windows,
- Button controls.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|