Pixmap Editor

Along with the Pixmap Chooser, allows you to create, load, edit, and apply pixmaps. The Builder Xcessory reads pixmaps in XBM and XPM.1, XPM.2, or XPM.3 formats, and writes XPM.3.

Using XPM.1 or XPM.2 pixmaps

To use XPM.1 or XPM.2 pixmaps in your interface, use one of the following methods:

· Load the pixmaps into the Builder Xcessory and write them out as XPM.3.

· Edit the code to conform to XPM.3, and insert it within the convenience routines at the top of the creation-c.c file.

Pixmap Chooser

The Pixmap Chooser is the first window displayed:

Pixmap Chooser Window

Choose a Pixmap

The Pixmap Chooser displays a list of pixmaps in the Choose a Pixmap field. Select a pixmap from this list by clicking on its name. The default pixmap, Unspecified Pixmap, unsets the resource when selected.

Function buttons

You can perform the following Pixmap Chooser functions on an existing pixmap:

· Load reads the pixmap specified in the Selection text field into the editor.

· Edit displays the Pixmap Edit window for the currently selected pixmap.

· Copy copies the selected pixmap. You are prompted for the name of the new pixmap.

· Delete removes the selected pixmap from the Pixmap Chooser.

Editing a Pixmap

The Pixmap Editor features a Panner/Porthole combination, like that used in the Browser, which allows the user to scroll the drawing area in two dimensions.

The Pixmap Editor creates a simple color pixmap editor that allows users to generate graphics for use in an application. It supports many common functions including point, line, circle, filled circle, rectangle, filled rectangle, moving and copying areas, flood fill, and undo. The image may also be resized or zoomed by the user.

Pixmap Editor

The following sections describe Pixmap Editor functions:

Undo

To undo the most recent operation (only the most recent operation can be undone) select the Undo button.

Set All

To fill the entire image with a given color, and erase its current contents, select the Set All button.

Draw Point

Draws single points on the display in the current color. To draw a single point, click and release MB1. To draw multiple points, click and drag the mouse, points are drawn until the mouse button is released.

Draw Line

To draw a line, press MB1 to set one end of the line, then drag the mouse and release the mouse button to set the other end of the line.

Draw Circle

To draw a circle, press MB1 to set the center of the circle and drag to set the radius of the circle.

Filled Circle

To draw a filled circle, press MB1 to set the center of the circle and drag to set the radius of the circle.

Rectangle

To draw a rectangle, press MB1 to set one corner of the rectangle, then drag the mouse and release the mouse button to set the opposite corner.

Filled Rectangle

To draw a filled rectangle, press MB1 to set one corner of the rectangle, then drag the mouse and release MB1 to set the opposite corner.

Copy

To copy an area of the screen to another location, press MB1 to set the upper left-corner and drag out a rectangle encompassing the area to copy. Release MB1 and move the selected area to the upper-left corner of the new location and click MB1 to complete the copy. The image in the original location is unchanged and a copy is placed in the new location. To cancel a copy operation once the original area has been selected, select the copy icon again.

Move

Similar to the copy operation. However, after moving the area to a new location, the original area is removed by filling it with the currently selected color.

Flood Fill

To flood fill an area, choose a location and click MB1. All contiguous pixels of the same color are changed to the current color.

Selecting and adding colors

The color bar allows you to select which color each of the previous graphics operations uses.

The color bar, located between the editable pixmap and the control panel, is a bar of rectangles, each of which corresponds to one color in the pixmap. The (+) button at the top of the bar allows you to add colors to the bar.

The current color is denoted by a check mark. When you selecting a new color it becomes the current color. To add a new color to the color bar, click on the (+) button at the top of the bar. To change a color, double-click on that color in the color bar. The Color Editor dialog, allowing you to change that color, is displayed.

Resizing the pixmap

To resize the pixmap, press MB1 on an edge of the small pixmap display, drag it to a new location, and release the mouse button. The size of the new image is displayed (in pixels) in the upper left corner of the small pixmap. When the image is made bigger all new pixels are set to the current color. When the image is made smaller only the upper left portion of the image that fits on the screen is saved.

Panning and zooming

The Pixmap Panner allows you to zoom and pan the pixmap. Grabbing the Pixmap Panner with MB1 allows you to move your current view of the pixmap to a new location. For example, dragging the Pixmap Panner to the extreme top right of its bounding area allows you to see the extreme top right corner of the pixmap. If the Pixmap Panner completely fills the area, then the entire pixmap is currently shown and the Pixmap Panner cannot be moved. When the Pixmap Panner has the keyboard focus, it can also be moved by using the arrow keys.

To zoom the image in and out, use the up and down arrow buttons. This changes the magnification of the drawing pixmap. A magnification of 8x means that each pixel in the real pixmap is represented by an 8x8 rectangle in the pixmap editor. Zooming in and out does not change the image in any way, it only affects your view of the image.

Pixmap Editor dialog

Two buttons appear on the bottom of the Pixmap Editor dialog:

· Apply sets the currently selected pixmap to the pixmap in the drawing area and removes the Pixmap Editor.

· Dismiss removes the Pixmap Editor without updating the pixmap.

 

Documentation: