DotgRafix - a DOS graphics program

DotgRafix is a DOS graphics program written in Borland C++ as a course project. It allows you to create 16 color images, which can be saved to disk and exported to Windows BMP files. DotgRafix can work as either a paint program (like Windows Paintbrush), or a simple design program in which you create and position graphic objects using drag and drop (like Powerpoint).

msgfrm picture

If you're looking for code...

I've gotten two requests from people looking for code to read and write BMP files. I don't plan to put up all the DotgRafix code, since its ugly and messy, but here's a short example program that uses the Borland C++ compiler: bmptest.zip. The program draws on the screen using the Borland graphics driver, saves the screen to a BMP file you can read in Paint and then restores it from the file. For better info on things like this, I recommend the tutorial on DOS VGA Graphics at Happy Puppy.

Back to my Program...

In the paint mode, you can draw freehand lines in different styles (line widths) using the mouse, insert simple text labels, and fill black-bordered areas with a color of your choice. You can also create basic geometric shapes (straight lines, filled or empty rectangles, filled or empty ellipses), which can be copied or used as "brushes" to create interesting effects or erase parts of the image.

In the "object" mode you are given a set of tools for working with graphic objects. You can create text labels, geometric shapes and straight lines, and then copy, delete or move these shapes (with drag and drop) around the screen. The program redraws all the shapes when you move them, so this doesn't erase any drawn objects, but can erase things drawn in paint mode. Additional functions allow you to change an object's color, or shuffle the order in which objects are drawn on the screen (move an object before or behind another, for example).

At any time, you can switch between the two modes, save your work to a file (in two possible formats) or load a different file, using a pull-down menu.

DotgRafix allows you to save your work as either a native format file, which (by our convention) has the ending .RIB, or as a Windows BMP. RIB files load and save much faster, particularly when running in MS-DOS mode (as opposed to running from a Windows 95 DOS prompt). RIB files also contain information that allows the program to recreate any graphic objects in the image.

You can also load Windows BMP files into DotgRafix (that's how the splash image that is shown at start up was created), but the width of the BMP file must be a multiple of 32 pixels. The image should use 16 colors and shouldn't rely on color contrasts too heavily, because the Windows palette information doesn't map properly to the DOS colors (this explains the psychedelic color scheme in the splash screen).

You can download DotgRafix as a zip archive (127 KB), which contains the program (DOTGRAF.EXE), the Borland C++ DOS graphics driver (required to run the program), some sample images, and the icons, which are RIB files, and need to reside in the sub directory NEWICONS in the program directory. If you're using Winzip, you can just extract the whole thing into a directory (winzip will create a directory for the program, so you don't need to make a special one) and type "dotgraf" at the prompt to run.