Older Newer
Thu, 19 Dec 2019 14:51:41 . . . . SyneRyder [Initial definition]


Changes by last author:

Added:
= zoomFactor =

== Syntax ==

int zoomFactor

== Description ==

An integer between 1 and 16 to indicate the current zoom factor of the proxy preview window, or 0 if the proxy zoom factor has not yet been set. (In the current implementation, the zoomFactor variable is essentially the same as the built-in scaleFactor variable.)

== Example ==

<code>

%ffp

ctl(0): STATICTEXT, "Please right click on the preview to set a cross.", size=(100,20)

OnCtl(n): {

if (n == CTL_PREVIEW &amp;&amp; e == FME_RIGHTCLICKED_DOWN) {

j0 = getPreviewCoordX() * zoomFactor;

j1 = getPreviewCoordY() * zoomFactor;

doAction(CA_PREVIEW );

}

return false;

}

ForEveryTile: {

int g, h, z, color;

int PreviewX = j0/zoomFactor;

int PreviewY = j1/zoomFactor;

// Calculate color of the cross

color = ( src(PreviewX, PreviewY, 0) + src(PreviewX, PreviewY, 1) + src(PreviewX, PreviewY, 2) ) /3;

if (color &gt; 128 &amp;&amp; color &lt; 196) color=0;

if (color &gt; 64 &amp;&amp; color &lt; 128) color=255;

else color =255-color;

// Display Cross

if (doingProxy){

for (z=0; z &lt; Z; z++) {

for (g=-7; g &lt; 8; g++)

if (g &lt; -1 || g &gt; 1) pset(PreviewX + g, PreviewY, z, color);

for (h=-7; h &lt; 8; h++)

if (h &lt; -1 || h &gt; 1) pset(PreviewX, PreviewY + h, z, color );

}

}

return true;

}

</code>

== See Also ==

Constants, scaleFactor, setZoom