
          AnfyLens 2.1 - Copyright (C) by Fabio Ciucci 1996/97


This applet can simulate a lens moving over any GIF or JPG image.
Remember that are needed both AnLens.class , Lware.class and anfy.class.
You must upload these 3 .class files and insert the <applet> tag on your
html document to add this applet to your page.
This applet is fully parametrized, so you can generate all kinds of lens
you want. Here an example of what you have to write in the html (the
things anfter the ; are comments with min-max values acceptet):


<applet code="AnLens.class" width=320 height=256> ; Name, Width, Height
<param name=credits value="Applet by Fabio Ciucci (www.anfiteatro.it/java.html)">
<param name=regcode value="NO">         ; Register code (if you have it)
<param name=reglink value="NO">         ; URL where go optionally when clicked
<param name=regnewframe value="YES">    ; Reglink opened in new frame?
<param name=regframename value="_blank"> ; Name of new frame for reglink
<param name=statusmsg value="Lens applet">  ; Statusbar message
<param name=image value="facet.jpg">    ; Image to load
<param name=lenswidth value="35">       ; Size of lens
<param name=distdval value="10">        ; Diagonal distortion (5 .. 20)
<param name=distoxy value="0">          ; XY distortion (-40 .. 40)
<param name=zoomfactor value="5">       ; Zoom factor (0 .. 30)
<param name=interactive value="YES">    ; Interaction ("ON" .. "OFF")
<param name=distort value="YES">        ; Distortion ("ON" .. "OFF")
<param name=spdx value="2">             ; X speed (0 .. 8)
<param name=spdy value="1">             ; Y speed (0 .. 8)
<param name=memdelay value="1000">      ; Memory deallocation delay
<param name=priority value="3">         ; Task priority (1..10)
<param name=MinSYNC value="10">           ; Min. milliseconds/frame for sync
Sorry, your browser doesn't suppor Java.  ; Msg in no java browsers
</applet>


NOTE: Don't place "; comments" on final HTML!!!

Copy and paste in your html document this cleared and correct tag:


<applet code="AnLens.class" width=320 height=256>
<param name=credits value="Applet by Fabio Ciucci (www.anfiteatro.it/java.html)">
<param name=regcode value="NO">
<param name=reglink value="NO">
<param name=regnewframe value="YES">
<param name=regframename value="_blank">
<param name=statusmsg value="Lens applet">
<param name=image value="facet.jpg">
<param name=lenswidth value="45">
<param name=distdval value="10">
<param name=distoxy value="0">
<param name=zoomfactor value="5">
<param name=interactive value="YES">
<param name=distort value="YES">
<param name=spdx value="2">
<param name=spdy value="1">
<param name=memdelay value="1000">
<param name=priority value="3">
<param name=MinSYNC value="10">
Sorry, your browser doesn't suppor Java.
</applet>


                             ---------


Here detailed instructions about how to change parameters:


The credits parameter can't be changed otherwise the applet will not work.

To activate the reg parameters read the shareware registration notes.
In the "regcode" parameter you have to place the registration code you
purchase from the author. If it is correct and the applet is run from the
registered domain name, you can use "reglink" parameter, where you can specify
an URL where bring user when the applet is clicked.
If you set to "YES" regnewframe, you can specify a frame where load the
reglink:

"_blank"  : To load the link in a new blank unnamed browser window.
"_self"   : To load the link into the same window the applet occupies.
"_parent" : To load the link into the immediate FRAMESET parent.
"_top"    : To load the link into the top body of the window.

Otherwise the frame name, for example "myframe1".

You can load any GIF or JPG image, remember to write the right size in
the width and height tags.

You can choose the width of the lens with the parameter "lenswidth".
Greater lens mean slower movements.

If you select "NO" to "distort" parameter, you will disable distortions, and
the zoom will be plain (this is useful especially for applications where the
image is zoomed to view it better).
NOTE: This parameter was added in the 2.0 version because many people asked
to add it.

With the "distdval" parameter you select the diagonal distortion.
To have a perfect sphere use the value 10, smaller values or higher
values (the range is 5 .. 20) will change the lens distortion.

The "distoxy" value (-40 .. 40) will distort X for negative values and Y
for positive values. Choose 0 for normal spheric distortion.

As you know, lens are useful to zoom images. With "zoomfactor" you will
change the ability of zooming of the lens. With a value of 0 any zooming,
only distortion. With higher values higher zooming.

Since is nice to test this effect with mouse movements, is enabled the
feature of interactive placement of the lens. Usually the lens is moved
around the image automatically, but if you set to "YES" the "interactive"
parameter, the user can move the lens with the mouse when is over the
applet area. The automatic movements will restart after 2 seconds of no
user activity. If set to "NO" the user will never interact.

You can control the speed of automatic movements with "spdx" and "spdy"
parameters.


                             ---------


Compatibility parameters:


The "memdelay" parameter is useful only to run the applets without problems
on some bugged versions of Netscape 3, that don't deallocate correctly
the memory allocated, resulting in filling all the memory after a minute
the applet is running. This can cause also a system crash in some cases.
Last versions of browsers have fixed this problem, but if you want to run
the applets on old bugged browsers too, set "memdelay" to low values, like
"10" or "16", for example.
But this will slow down a lot the applet speed, so you have to choose
between speed (memdelay set to 1000 or higher) or slow compatibility with
old browsers (memdelay set to 20 or lower).

The "priority" parameter is useful mainly when you are running more than
one applet in same page, and one slows down or hangs.
If this applet run too slow or hangs because other one steal all the CPU
power, try increasing the priority.
Otherwise, if this applet runs well and others slows down, decrease the
priority. Consider the min priority is 1, normal priority is 5, and the
max priority is 10. Usually a priority of 3 is ok for single applets.

The "MinSYNC" parameter must be set to a value between 8 and 16 to slow
down animation in the case it runs too faster on faster computers or because
the applet size is very small. The optimal value seems to be 10, but you can
disable this feature placing a value of 0 if you see flickerings or excessive
slow down.
If the applets steal 100% of CPU power or slows down the browser and Operating
System, try increasing MinSYNC until all runs ok.
Usually values between 40 and 400 fixes all problems, even if applet slows
down for compatibility.

                             ---------


Copyright and distribution notices


Fabio Ciucci is the author and owner of this applet.
The image used as sample is by Facet.
You can use freely this applet to enhance your web pages. But since I am
the author of the applet, I placed a secret linkware window that will appear
if the applet is clicked with mouse, only when the applet is online on a site:
it is external to the web browser, so it will not hit the design of your
beautyful html page.
This small window will simply show my name and ask for a link to my java
applets page.. the user can connect to it or cancel, or hide the window and
connect after visiting all your pages.
I hope this credit part is not a problem for you...
In any case, if link is accepted a new browser window will appear and your
page will remain on the original window, so you will not lost the visitor.
Consider you will use an effect programmed by me, without pay, for FREE!

NOTE: You can include the applets archive on CD-ROMS or shareware collections
and shareware sites without ask me, but only if you leave the archive(s)
unchanged.

                             ---------


Fabio Ciucci

fabioc@anfiteatro.it

http://www.anfiteatro.it/java.html


