OriginalSize
property for PowerScript controls
Applies to
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 2 3 4 5 6 7 8 9 10 11 |
integer li_width, li_height li_width = p_1.width * 2 li_height = p_1.height * 2 parent.setredraw(false) p_1.setredraw(false) if p_1.originalsize then p_1.originalsize = FALSE p_1.width = li_width p_1.height = li_height p_1.setredraw(TRUE) 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.