Behold the Dancing Pigs!
(Netscape version)
|
To use this applet, drag and click on the image. The
image will "warp" based on drag. When you are comfortable with the
changes you have made to the image, press the save button to write a
copy of your work in GIF format to disk.
* Please note that some older versions of Communicator may not support the SAVE option because the browser's Java VM does not contain java.awt.FileDialog.
Capabilities Code
Because this applet is signed with Netscape Object Signing Class 2
Digital Certificate from Verisign, the applet may be
allowed to write to the local disks. The code that requests the
capabilities and that causes the security dialog box to pop up looks
like this:
|
FileDialog fd = new FileDialog(new Frame(), "Save as GIF");
fd.setMode(FileDialog.SAVE);
fd.show();
if(fd.getFile() != null) {
try {
PrivilegeManager.enablePrivilege("UniversalFileWrite");
FileOutputStream out =
new FileOutputStream(new File(fd.getDirectory(), fd.getFile()));
new GifEncoder(mImage, out).encode();
out.flush();
out.close();
} catch (IOException ioe) {
showStatus("couldn't write the gif: " + ioe.getMessage());
} catch (ForbiddenTargetException fte) {
showStatus("permission denied: " + fte.getMessage());
}
}
|