Copyright (c) 1989 Leland Green. . .
All rights reserved.
Shareware! You may freely copy and distribute this program if you find it
usefull as long as you do not charge more than $10 for copying. You may not
make any additional charges, for shipping, or anything else, either!
Changing any of the files in the file list (including this file), or
distributing archived (compressed) versions with any of those files missing
is a violation of the copyright laws! (The file list is at the very end of this
Graphics modes and hardware requirements:
If you choose a graphics mode that your hardware does not support you will
see an error message stating such, after which the program will go into the
default mode (the highest possible mode, normally).
This program was written to take advantage of my VGA card. However, this
version will run on any IBM compatible graphics configuration (tested to date),
including CGA & Hercules. With a monochrome monitor you must run MsHerc.com
first. If you are serious about computer graphics I would recommend a MCGA or
VGA compatible monitor and card. The price is more but you get what you pay
The highest possible mode this program supports is #19. This requires a VGA
(or PS/2) with an analog (color or mono) monitor. MCGA cards should support
this mode, too, if your MCGA monitor does. This is the 320x200 256 color mode.
On a monochrome monitor (MCGA or analog) this is (effectively) translated to a
64 gray scale.
To start the program simply type VGAGRAF
you will see the top menu after a short pause. All items on the main menu are
active except "Set up modeling studio" which is reserved for initializing the
3-d functions in later versions. To get to the Easel, choose "Start Painting",
then "Paint". There will be a pause as everything is initialized (first time,
only). The length of this pause depends on the mode you are in. You should
then see the mouse cursor appear in the top left corner of the screen.
If you choose an option that is not supported you simply 'pop-back' to the
menu you selected it from. This will not hurt anything. Why put menu items in
that do not work? I have big plans for this program and have designed it to be
easily expandable. In other words these are goals I have set for myself.
this quits to DOS. You may also use the right mouse button as an
keypress in any menu. (This will not work in painting mode(s).
The left mouse button works as the
3. The only other keys supported are the arrow keys. If you have an "XT-style"
keyboard make sure the number lock is off. On an "AT-style" (enhanced,
or 12 function keys) use the arrow keys. You may also use the mouse to
move the menu bar. The highlight will "wraparound" from top to bottom &
4. Mouse motion is detected in the vertical directions (only) and moves the
Help is now available in most areas by pressing
The pencil (lines)
While in line mode the right mouse button will move the start point of the
line. The left button draws a line from the current starting point to the
cursor point. The current starting point is then updated to the cursor point,
All lines are drawn in the current color.
Rubber banded lines
At program start up all lines, rectangles and ellipses are rubberbanded. This
means you still choose a starting point (the last ending point for lines) by
is 'stretched' (or rubber banded) to the cursor location. You may continue to
move the mouse. The line moves each time you move the mouse. The line is not
'dropped' until you
fills on. The fill does not occur until you release the button and then fills
to the current color (not the stop color as used in Flood Fill mode).
button still draws lines in the current color, but the starting point is not
moved. Play with this to understand it better.
the bounding rectangle) and the
rectangle, then draws the ellipse within it. (The rectangle does not show.)
In line mode flood fills are executed. This is a little different than some
programs because the right button will select the 'stop' color. That is, the
fill starts at the cursor and continues in all directions until the selected
'stop' color is encountered. The default stop color is black (default drawing
In ellipse & rectangle mode the
memory. See the section "When you drawing is saved".
<+> Cycles forward to the next palette color.
<-> Cycles backward one palette color.
EGA & VGA Color Commands
The R,G & B keys now control the amount of red, green and blue output to
the monitor. Capital letters increase the amount of the corresponding color
while lower case letters decrease the color amount (or intensity). If you take
a color below 0 it 'wraps around' to 63 (the highest possible value for red,
green or blue). The opposite is also true. These may be used in the color
palette menu or in paint mode (while you are drawing). When you change a color
it immediately changes the color wherever it appears in your painting.
allow you to edit the colors in the palette. You will see the color
menu. After the mouse cursor reappears choose the color you wish to edit. The
cursor will then disappear (again). At this point you may use the R,G,B,r,g,b,
o,O,0 and F1 keys.
<0> zeros all values (sets them to black).
to choose another color (with the left button) or quit to your drawing (right
button). This is explained with context sensitive help so you don't have to
remember it all. If you get confused press
PLEASE NOTE: I have allowed you to edit ANY and ALL colors! This includes the
default foreground and background colors! If you set these to the same value
your cursor may disappear in draw mode! You can also change the color of the
cursor (the solid one, anyway) by editing color #15 (the top right color)
and/or color #0 (the top left color). This is one reason I laid out the
palette as I did, by putting the 'mouse colors' in corners you can hit them
'blind' if you have to.
Clearing the screen
Do this from the file menu. Simply choose Clear Picture. You will NOT be
prompted to continue! The picture is immediately lost!
change video modes, load a picture from disk or (of course) if you clear the
The default mouse cursor is one designed by me. It changes colors depending
on what is underneath it. This is often desirable since you can 'see through'
the cursor. However, this sometimes causes the cursor to be practically
invisible (depending on what you have drawn). Because of this you may toggle
the cursor type by pressing
color 15) with a white (or color 0) edge. This is visible at all times.
The next press of
cross hair cursor that moves with the mouse. This slows down the screen
updating, slightly. I recommend moving the cursor to the approximate position
and then switching to the full screen cursor for 'fine tuning' the location.
This will allow you to line up points exactly (horizontally or vertically)
with anything on the screen.
A third press of
pixel unchanged. This cursor is also visible at all times (at least 1/4 of it)
since the 'hot spot' is in the center. That is you can still see it when you
move to the edge or corner of the screen.
Finally, a fourth press of
When your drawing is saved
In order to allow switching of screens on cards with limited graphics
capabilities the entire screen is saved to a buffer in memory. Do not confuse
this with saving to disk! (As in the Files section)
(I tried using temporary disk files but that takes too long.)
Any time you quit to the menu your screen is saved to memory. It will also be
saved when you choose the Color or Palette menu.
NOTE: Changing tools does NOT save the screen! This allows you to Undo
everything since the last save, regardless of how many tools you have used.
The file menu is pretty self-explanatory.
The Default file type selection simply lets you change the file mask for
All files are loaded/saved in the current working directory.
When you choose Save or Load you will see a listing of all files matching the
current mask (default is *.vga).... Pressing any key will stop this listing
and prompt you for a file name (which defaults to VGATEMP.VGA).
If you try to overwrite an existing file you will be prompted to continue.
You are also prompted to verify that you want to load a picture, since this
will erase your painting.
File formats (For all you hackers)
All screens are saved/loaded in my own format. Watch for more formats in
future versions, including GIF, PCX, TIF, etc. I would appreciate
documentation on any formats. (I think I have enough to incorporate the ones
mentioned, at least.)
If you try to load a picture that was created in a mode other than the current
one the program will automatically switch modes. If your hardware does not
support that mode you will be informed.
My own format includes the palette and video mode in the file. The mode is the
first byte. The next ??? bytes contain color information. The format for the
pixels depends on the mode. 256 color modes are saved one byte per pixel with
other modes being compressed. If you would like the technical specs for this
please let me know. Personally I think it has room for improvement, thus my
plans for other formats. It does admirably well in the 320x200 modes, being
fairly quick (quicker than some commercial programs I've seen). It gets pretty
slow in the 640x350 modes, though.
The EGA 16 color modes take a maximum of 113k.
The VGA 256 color mode takes almost 65k of disk space.
I have NOT included compression of data in the black & white modes! This means
That a picture done in the 640x350 B&W mode still takes 224k! (I figure nobody
will use that one, since it requires EGA.)
Future versions will support compression and different file formats (as
mentioned above) .
Perfect Vision Digitizer support:
The actual digitizer input routine was Copyright 1988 by
Terry T. Rockwell and SunRize Industries, Inc.
Used with permission.
Pressing D in an EGA or VGA mode will grab a screen from the Perfect Vision
digitizer. The default port is LPT2. You may chage it by choosing the options
menu and then choosing the digitizer options selection. You will have to
change this EACH TIME you start the program.
If you do not change the port # before pressing D the program will most likely
'lock up' anything connected to the current port. For example, with my printer
connected to LPT1, if I choose that port it locks up my printer until power
off (power off of the computer!)... This will be corrected as soon as
Input from the digitizer is continuous until you press a key or if you hold
grabbing frames as soon as the current screen is drawn (completely).
The EGA picture takes a lot longer. For that reason I have included a check
for a keyboard press during the actual 'translation' of the picture. This
allows you to adjust the contrast or brightness without waiting for an entire
The results on the VGA are a lot quicker so a keypress stops only after
the screen is 'full'.
VGA images are loaded using the odd scan line gray intensities, only.
640x480 monochrome mode (VGA/MCGA) uses my own algorithm which I call
'dithered smoothing'. This is similar to 2x2 dithering but also contains
my own 'averaged smoothing' algorithm. This is desirable for some images more
than others. Generally this will help diagonal lines and will artificially
shade vertical lines. This has the effect of enhancing the light source in
some images. It seems to help on most faces or other complex forms, too.
640x350 (EGA) mode pictures are grabbed using a similar algorithm but results
are 'compressed' to the 4 gray levels supported on EGA. I like to think of
this as 'pseudo dithering'. This is very similar to the smoothing algorithm
You may then paint or otherwise modify the picture you have grabbed.
If you are interested in a digitizer contact SunRize Industries at the address
below (see the 'Thanks' section). I am not an agent for them....
Hercules graphics mode has a problem with the mouse driver. I know how to fix
this (I think) but have not had time to work on it. If you have a hercules
(or compatible) monochrome monitor and would like a working version, please
drop me a post card and I will notify you as soon as this bug is fixed.
In order to speed up the screen saves I have eliminated any error checking
during the actual disk writes. Because of this the system will lock up if you
don't have enough disk space. Future (registered) versions will support full
error checking on disk writes.
If you find any other bugs, please let me know! Thanks.
That's it so far! (I think!:)
I would appreciate any feedback and/or comments!
Send correspondence to:
Leland Green. . .
P.O. Box 4111
Springfield, MO 65808-4111
3801 Old College Rd.
Bryan, TX 77801
Phone: (409) 846-1311
for allowing me to use their assembly language routine
that grabs the picture from their Perfect Vision Frame grabber.
Ken Slaughter, Advanced Software Technologies, Inc., for his patience and
help getting me started in the C language. He has always been there to answer
my questions about C and Assembly. Since I am mostly self educated he is the
only 'tutor' that I ever had.
William Middleton for helping test this program and reporting several bugs
before the first release. Also for helping me distribute the early versions.
(William is the sysop of the Tech BBS, number above.)
Chris Chang, Paradise Systems, Inc., Technical Support Department, for helping
me with information that I could not find in the public domain (or in any
books). Also for taking a sincere interest in this program.
Listing of archive : 'VGAGRAF4.LZH'
Name Original Packed Ratio Date Time Attr Type CRC
-------------- -------- -------- ------ -------- -------- ---- ----- ----
6749 3918 58.0% 88-03-07 5:10:00 ---w -lh1- 7E74
747 432 57.8% 89-05-05 23:54:06 a--w -lh1- BC22
1229 582 47.3% 89-04-27 18:23:50 a--w -lh1- 13EC
276 185 67.0% 89-04-22 17:04:24 a--w -lh1- 948E
514 300 58.3% 89-04-22 17:01:32 a--w -lh1- 748F
126738 65351 51.6% 89-05-05 23:08:46 a--w -lh1- CE8A
-------------- -------- -------- ------
7 files 151769 77663 51.2%
If files and/or crc's and/or file sizes don't match, please notify me
immediately as that is a violation of copyright laws!