You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The sizing behavior of the control's image.

Usage

Set_Property(OLECtrlEntID, "OLE.Layout", OptionValue)

Values

OptionValue can be set to one of the following valid options:

ValueAbbr.Description
ClipCDraws the image in its normal size and clips anything beyond the edges of the control
StretchSDraws the image to the dimensions of the control, i.e., big images shrink to the size of the control and small images expand to the size of the control.
TileTFills the entire controls with the image in its original size. If the image is smaller than the control, it is repeatedly drawn until the control is filled
ThumbnailTHShrinks the image to fit inside the control while maintaining its aspect ratio. If the image is smaller than the control, then it is aligned according to the Alignment property
PanPDraws the image at the current zoom level with scrollbars

Default: Clip

Remarks

The Layout property provides a variety of ways for the images to be sized in relation to the size of the control. By default, this property is set to clip, which simply positions the image within the control according to the Alignment property and clips the image if it happens to be larger than the control.

The Stretch layout stretches or shrinks the control to have the same proportions as the control. The Alignment property is ignored since the image is always the same dimensions as the control.

The Tile layout ignores the Alignment property completely and repeatedly paints the image in it's orginal size until the control is completely filled.

The Thumbnail layout also ignores the Alignment property and insures the image will always be displayed in it's original proportions. If the image is smaller than the control, it is position within the control according to the Alignment property. If it is larger, it is shrunken to fit within the control without compromising the image's aspect ratio.

The Pan layout provides a more interactive view of the picture. This layout ignores the Alignment property opting instead to show the image with scrollbars, which allows the user to pan the image as desired. Furthermore, the image can be scaled in size using the Zoom property or by holding the CTRL key while scrolling the mouse wheel.

Example

// Stretch the image to fill the control 
Set_Property(@Window:".OLE_PICTURE", "OLE.Layout", "Stretch") 

// Show the image in thumbnail view, always maintaining the aspect ratio 
Set_Property(@Window:".OLE_PICTURE", "OLE.Layout", "TH") 

// Show the image in pan view, allowing the user to pan and zoom 
Set_Property(@Window:".OLE_PICTURE", "OLE.Layout", "Pan")

See Also

AlignmentZoom

  • No labels