
Picket-Fence Animation in Java
==============================
  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat Yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th
  http://fivedots.coe.psu.ac.th/~ad/fence


If you use this code, please mention my name, and include a link
to the website.


==========================================================

Contents
--------

* PicketFence.jar
    -- this also contains the Java source code

Examples:

  * A stick man waving, in 4 frames: 
    - man00.png, man01.png, man02.png, man03.png

  * A stick man walking, in 7 frames:
    - walk00.png, walk01.png, walk02.png, walk03.png, 
      walk04.png, walk05.png, walk06.png
    - in the subdirectory walk/


----------------------------
Execution Examples:

  > java -jar PicketFence.jar man 4               

  > java -jar PicketFence.jar "walk/walk" 7


  * supply the name part of the filenames, and the number of images

  * two output files are saved in the local directory
    - fence.png, interleaved.png
   

----------------------------
A Possible Problem:

Your anti-virus software may stop the JAR from creating the two
output files. The error message will be something like:

     java.io.FileNotFoundException: .\fence.png (Access is denied)
        at java.base/java.io.RandomAccessFile.open0(Native Method)
        at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:347)
              :
        at FenceAnim.makeFence(FenceAnim.java:189)
        at FenceAnim.animate(FenceAnim.java:103)
        at FenceAnim.main(FenceAnim.java:57)
      Unable to save image to ./fence.png

Your have two options:

  1. Add the JAR file as an exception to your anti-virus software.
     It should ask you about this when the JAR's execution is blocked.
or
  2. Unzip the JAR file, and execute the Java class files on the
     command line. The two earlier examples, are then executed like so:

       > java FenceAnim man 4

       > java FenceAnim "walk/walk" 7


----------------------------
Compiling

The Java source code is in the JAR file, and is free to reuse and modify.
The code can be executed like so:

    > javac --release 11 *.java


-----------------------------
Last updated: 10th September 2022
