Page 219
Quick Nav Bar
<<   Previous Contents
Selection
Op Index
Parent User Notes
Index
Glossary
Next   >>


Utility Functions for your scripts

a=PROGRESS(amount) [returns 1 for abort requested] [amount is of y2-y1]

When a script is invoked, WinImages F/x takes note of the vertical extent of the area selection the user makes. It sets the progress bar so that the bar will go from empty to full following "amount" from zero to the number of Y lines, minus one.

There are several ways this can be used, but the most straightforward is to get the Y selection extents, and then process the selection, passing (Y-Y1) to the progress function.

Here's an example of how you might use the PROGRESS() command just that way:

 10 REM Demonstrates how to process an area selection
 20 REM performs color negative function
 30 X1=GETX1(0): Y1=GETY1(0)
 40 X2=GETX2(0): Y2=GETY2(0)
 50 FOR Y=Y1 TO Y2
 60   A=PROGRESS(Y-Y1): IF A=1 THEN END
 70   FOR X=X1 TO X2
 80     A=PUTRED(X,Y,255-GETRED(X,Y))
 90     A=PUTGREEN(X,Y,255-GETGREEN(X,Y))
100     A=PUTBLUE(X,Y,255-GETBLUE(X,Y))
110   NEXT X
120 NEXT Y 


Quick Nav Bar
<<   Previous Contents
Selection
Op Index
Parent User Notes
Index
Glossary
Next   >>
Page 219

WinImages F/x, WinImages Morph and all associated documentation
Copyright © 1992-2007 Black Belt Systems ALL RIGHTS RESERVED Under the Pan-American Conventions

WinImages F/x Manual Version 7, Revision 5, Level B

HTML Documentation Management System © 1992-2007 Black Belt Systems