stretch

Type: Integer

Availability: Read or write at any time for pictures, read or write at run time only for tables

The stretch property determines how a picture stretches to fit the size of a Picture control. The stretch property settings for a Picture control are listed in the following table.

Picture Class Constant Value Description
Stretch_None 0 The picture box size does not change to fit the picture size. If the picture is too large, the image is clipped.
Stretch_ToControl 1 The picture is resized to fit the control size. This may cause distortion of the image.
Stretch_ControlTo 2 The control stretches to fit the picture size. If the picture is large, the control may be enlarged so that it overlaps other controls or no longer fits on the form.
Stretch_Proportional 3 The control is sized proportionally to the picture. The picture is then stretched to fit the control. This means that the picture is always drawn in isotropic proportions to its original size. When the control size is determined, the width or the height decreases (not increases) to keep the same proportional view of the picture.
Stretch_Pic_Proportional 4 The picture is sized proportionally to fit the control. The picture is centered horizontally or vertically if the resized picture does not fill the control height or width.
Stretch_CenterPicture 5 The picture is centered on the control.

If the value of the stretch property for a Picture control is non-zero, resizing the control also resizes the picture it contains. In addition, animated .gif picture files are not drawn stretched. The stretch property is used to resize the control to the GIF image if required, but the animation is always drawn at its normal size.

For an image containing transparency to display correctly in a Picture control or a JadeMask control as part of a Web-enabled application:

Images that are mostly white or black lose their clarity when displayed in a Picture control using the stretch property and the picture control is smaller than the image. When an image is stretched, JADE sets the Microsoft stretch mode to COLORONCOLOR, which means all pixels are treated equally, and Windows drops pixels when the image is reduced in size. The exception is for a 1‑bit image, where JADE calculates whether there were more white or black pixels and then sets the Microsoft stretch mode to BLACKONWHITE (white pixels are discarded instead of black pixels) or WHITEONBLACK (black pixels are discarded instead of white pixels).

From JADE 2018.0.02 and higher, JADE has been changed so that If the image consists of more than 50 percent of white pixels, JADE sets the stretch mode to BLACKONWHITE. Similarly, if the image consists of more than 50 percent of black pixels, JADE sets the stretch mode to WHITEONBLACK. This change improves the display of small images; for example, plan drawings.

For a Table control, the stretch property determines whether:

The settings of the stretch property for a Table control are listed in the following table.

Table Class Control Value Description
Stretch_None 0 All pictures displayed in cells in the table are drawn at actual size. If the picture is too large to fit the available space in the cell, the picture is truncated on the right or the bottom. If there is insufficient room for the picture and the text within a cell, the picture is truncated.
Stretch_Cell (the default value) 1 All pictures are stretched proportional to the size of each cell less the size of the text.
Stretch_None_Picture_First 2 No cell picture is stretched. If there is insufficient room for the picture and the text within a cell, the text is truncated.
Stretch_Cell_Picture_First 3 All pictures are stretched proportional to the size of the cell but no bigger than the actual picture image. The text is then displayed in any remaining space in the cell and may be truncated.

The stretch property of the Table control applies globally to all cells on all sheets of the table.

The code fragment in the following example shows the use of the stretch property.

table1.stretch := comboStretch.listIndex - 1;