Assignment for 05-830, User Interface Software, Spring, 1997.

Painting Benchmark Description

John Huebner
Konur Unyelioglu

1. Introduction

This benchmark is representative of interfaces used for the creation of and editing of images stored as bitmaps. It will allow the user to draw lines, paint lines with a square brush, erase portions of the bitmap, and draw roundtangles, in a fixed drawing window. The user will be able to select 4 colors and three line thicknesses from pallets. The user may also select rectangular regions of this window to cut, copy, or paste.

It is similar in style to Microsoft Paint, KidPics, MattDraw, MacPaint, PaintShopPro, Adobe Photoshop and Fractal Painter. (In increasing order of sophistication.) MS Paint was studied extensively to determine what the typical requirements for a paint program were.

Microsoft Paint has a single window with four sections and a menu. The window is partitioned into a left border, lower border and drawing area. The drawing area sprouts scroll bars as necessary. The bottom border has a color palette with 28 colored squares on the right and two overlapping squares on the left to indicate the currently selected foreground and background colors. The colors are selected clicking on the box of the color you wish to select. The left mouse button selects foreground color, the right button selects background color. The left border is divided into a tool palate and a dynamic rectangular area that displays a separate options palette for each tool. The tools supported are: Select, Erase, Fill, Sample ("Pick") Color, magnify, pencil, paintbrush, spray-paint, text, lines, curves, rectangles, polygons, ovals, & rounded rectangles. They are each represented by an icon (except selection, which has two). The selection feature can also be activated by the select-polygon icon, although the bounding rectangle of the polygon is selected, so there is no purpose for this.

We selected the key features mentioned above for our benchmark. The most advanced feature in MSPaint is the curve tool. Creating curves is also an area in which interfaces have not yet been standardized, but after reviewing available toolkits we left it out for simplicity. Spray paint is a limited paintbrush, and was therefore left out of the benchmark. Text, while useful, is not directly associated with painting, so it was left out. Rectangles, polygons, and ovals shall be represented by rounded rectangles.

2. Benchmark Specification

There should be one main window, with a large painting area and three palettes. The main window will be a fixed size and will not scroll. When the cursor is over the main window, it will change to match the icon of the tool currently selected. Use icons from your toolkit. Avoid generating extra icons. The painting area shall occupy no less than 2/3rds of the area of the main window. All painting shall be clipped to the painting area.

The palettes should detach and move about the desktop if support for floating palettes is in the toolkit. The palletes will be divided into a tool pallete, and a color pallete, and a line thickness pallete.

There should be a menu item and key command to exit the program. The menu item should be at the bottom of the leftmost menu, but conform to the look and feel of the platform. This window will respond to window manager commands. It will refresh if the window is covered and then uncovered. If the window is resized or moved the objects will remain in the same relative position with respect to the window's top-left corner. There should also be menu items for cut, copy and paste operations with associated key commands according to the guidelines of your platform.

The color palate should have four squares of color that are between 0.2 and 0.5 inches on a side, and a status panel consisting of a rectangle of the current foreground color. The default colors shall be selected at startup. The default colors shall be black for foreground and white for background. The background color cannot be changed.

The line thickness plate should display three line thicknesses. The current line thickness shall be highlighted. The default line thickness, which will be selected at startup, is 1. The user will select line thicknesses by clicking on his choice.

The tool palate includes buttons for line draw (pencil), paint with square brush, paint roundtangle, erase, and select.

Line draw will allow the user to draw a thin (as thin as possible) line that traces the user's movements in the current foreground color.

Paintbrush will draw a square the size of the current line width in the current foreground color. As the user moves the pointer, a series of squares should be painted on the painting area closely enough together to create the effect of a smooth-edged line.

Erase will paint a square in the background color using the same rules as the paintbrush.

Paint Roundtangle will allow the user to place rounded rectangles (roundtangles) on the painting area. When the user depresses the left mouse button, a feedback object (rubber-band-rectangle) is displayed. When the user releases the button, a rounded rectangle is drawn at the final size and location. the rectangles will be solid (filled in). If rounded rectangles are not supported in your toolkit, use rectangles.

Select will allow the user to define a rectangle on the screen until the area is de-selected. When the area is de-selected the dotted line will be removed, and the pixels it was drawn on top of will be returned to their original color. An area will be selected by dragging the mouse in the drawing area when there is not already a selection. This will create a feedback object ("rubber-band rectangle") that will result in a dotted rectangle being displayed to indicate the selection region when the mouse is released.

While an area is being selected, the copy, cut and paste menu commands should be enabled. (If nothing is selected, copy and cut should be disabled, and Paste should be disabled when there nothing has been cut or copied.)  Copy should copy the bits inside the selected region into the system clipboard if it is supported, or a private clipboard if it is not. Cut should do what copy does, but also fill the selected region with the background color. This shall be a permanent change to the bitmap. Paste should unselect the current selection (if any exists) and display a dotted rectangle that is the same dimensions as the bounding rectangle of the clipboard. The user should be able to move this rectangle about the painting window, including locations which may cause part of the rectangle to fall out outside the window (but this part of the rectangle will not be displayed). Paste should not empty the clipboard, so multiple pastes in a row will create multiple copies of the picture in the window.  Also, drawing operations should leave the clipboard alone--so Paste is still available after drawing something new.  When the user clicks on the mouse button, the bitmap in the clipboard will be copied to the location specified by the dotted rectangle, and the dotted rectangle will disappear. If you are using the system clipboard and there is a non-bitmap object in the clipboard, then Paste should be disabled.

This benchmark does not handle undo, scrolling, zooming, scaling, reading or writing files, printing, curves, dragging selections, stenciling, rotating, selecting/manipulating arbitrary or polygon regions, or filling of arbitrary regions.