OriginalSize property for PowerScript controls
Controls
Picture, PictureButton, PictureHyperLink, and Animation controls
Description
The OriginalSize property specifies whether the width and
height of the picture are set to their original values.
For Animation controls, it specifies whether the width and
height properties of the Animation control are set to the size of
the AVI clip.
In the painter, if you use the mouse to resize the control
or if you set the Width or Height properties on the Position tab,
the OriginalSize property becomes disabled and the check box becomes
unchecked.
Usage
In a painter
To set the picture to its original size:
-
Select the OriginalSize check box on the
General page of the control’s Properties view.
In scripts
The OriginalSize property takes a boolean value. The following
line sets the OriginalSize property to false:
|
1 |
p_1.OriginalSize = FALSE |
You should not try to change the width or height of a picture
control when OriginalSize is set to true, because
it can lead to unexpected behavior. In this example, the OriginalSize
property is checked and set to false before the control
is doubled in size:
|
1 |
integer li_width, li_height<br>li_width = p_1.width * 2<br>li_height = p_1.height * 2<br>parent.setredraw(false)<br>p_1.setredraw(false)<br> <br>if p_1.originalsize then p_1.originalsize = FALSE<br>p_1.width = li_width<br>p_1.height = li_height<br>p_1.setredraw(TRUE)<br>parent.setredraw(TRUE) |
The SetRedraw function must be called only
when the image is very large. Before performing multiple resize
operations of large JPEG images, set the name of the picture to
an empty string temporarily to avoid unnecessary lengthy recompilations.