GIF Editor

This tool provides a basic GIF editor as a viewer within the JBuilder IDE. It appears as the "Design" tab in the content pane when viewing a GIF image. A preview panel appears in the structure pane. The size of the image is shown in the header of the preview panel, while the current pixel location is shown in the status bar.

Several toolbars let you manipulate the image.

IconPurpose
Rotate anticlockwise Rotate the image 90 degrees in an anticlockwise (counter-clockwise) direction. Note: this does not work for non-square images in JBuilder 4.
Rotate clockwise Rotate the image 90 degrees in a clockwise direction. Note: this does not work for non-square images in JBuilder 4.
Flip vertically Flip the image along its horizontal axis so that top becomes bottom and vice versa.
Flip horizontally Flip the image along its vertical axis so that left becomes right and vice versa.
Move up and left Move the image one pixel up and to the left.
Move up Move the image one pixel up.
Move up and right Move the image one pixel up and to the right.
Move left Move the image one pixel to the left.
Move right Move the image one pixel to the right.
Move down and left Move the image one pixel down and to the left.
Move down Move the image one pixel down.
Move down and right Move the image one pixel down and to the right.
Zoom in Magify the image in the grid to double its previous size.
Zoom out Contract the image in the grid to half its previous size.
Save image Save any changes to the underlying file.
Reset image Discard any changes and revert to the last saved image.
Resize image Change the dimensions of the image - details outside the new boundaries are lost.
Help Display this file.

Move Drag the entire image to a new position - details outside the image boundaries are lost once you drop the image in its new position.
Cut Cut the selected area to the clipboard, replacing it with the background colour.
Copy Copy the selected area to the clipboard.
Paste Paste the contents of the clipboard into the selected area, clipping any image outside that area.
For the following tools, you can use the left mouse button to draw in the foreground colour, or the right one to draw in the background colour.
Draw Draw individual pixels in the current colour - you can drag to colour multiple pixels.
Pickup colour Make the colour from the selected pixel the current colour.
Fill Replace the colour clicked on, and all connected pixels of the same colour, with the current colour.
Line Drag to draw a line in the current colour.
Oval Drag to draw an oval in the current colour.
Rectangle Drag to draw a rectangle in the current colour.
Rounded rectangle Drag to draw a rounded rectangle in the current colour.
Filled oval Drag to draw a filled oval in the current colour.
Filled rectangle Drag to draw a filled rectangle in the current colour.
Filled rounded rectangle Drag to draw a filled rounded rectangle in the current colour.
Transpose Within the selected rectangle, replace all occurrences of the foreground colour with the background colour.

Colours Select the colour to use for drawing. The first button represents the foreground colour, while the second button is the background. Click the buttons to bring up a colour chooser. Press the button on the Transparent tab to make the foreground or background colour transparent. You can also use the Dropper tool to select an existing colour from the image.
Swap Colours Swap the foreground and background colours.

You can create a new GIF image by going to File | Open File and entering a new filename with a ".gif" extension. Then open up this viewer and create your new image, resizing as necessary.

To install the editor, just copy the *.jar file to the JBuilder/lib/ext directory, the *Doc.jar file to the JBuilder/doc directory, and restart JBuilder.

Portions of this code come from the JIconEditor component described by Claude Duguay in his February 2000 JavaPro article.

Writing out the GIF image uses the GIF encoder from Acme Java (http://www.acme.com/java/).


Version 2.1

Written by Keith Wood (kbwood@iprimus.com.au).