Older Newer
Wed, 29 Apr 2009 19:08:34 . . . . 203-59-91-239.dyn.iinet.net.au [Moved comments onto their own line to fit smaller browser windows]


Changes by last author:

Added:
= setZoom =

== Syntax ==

:static int setZoom (int n)

== Arguments ==

:n

::Lets you specify a zoom factor from 1 to 16. A value of -888 sets the default zoom that shows the whole image.

== Return ==

:Returns true if it succeeded and false if the current zoom factor is identical with the n parameter.

== Description ==

:Lets you set the zoom factor of the preview directly from code. But be warned! Only use setZoom in the OnCtl and OnFilterStart handlers, otherwise you will get some unwanted effects in the preview!

== Example 1 ==

<code>

%ffp

ctl(1): "Preview Zoom",Range=(1,16)

OnFilterStart:

{

setZoom(ctl(1));

return false;

}

</code>

== Example 2 ==

<code>

%ffp

//Puts a 100% button next to the default zoom control

ctl(100): PUSHBUTTON, "100%", Pos=(150,164), Size=(30,10)

OnCtl(n):

{

//Clicking the button sets the preview window to 100%

if (n == 100) setZoom(1);

return false;

}

</code>

== Also see ==

:scaleFactor

== Comments ==

:Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.