home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
011.lha
/
Draw
/
Vdraw.doc
< prev
next >
Wrap
Text File
|
1986-11-10
|
25KB
|
467 lines
****** Vdraw 1.08 7-Aug-1986 ******
******** New Stuff (since 1.03) *************
- Can now change the screen resolution via vdraw.profile
- 640 wide always
- 2, 4, or 8 colours
- 200 or 400 lines
- Now asks for file names in special input windows
- Added a high speed magnifing glass for precise alignment
- Added printing modes 2:1, 3:1, 4:1, 5:1
- Added poster size printing
- Ghosted non-implemented menu items
- Command keys for main functions
- Fixed bugs in text placement
- added 1.2 Kickstart support
- New area fill uses MUCH LESS memory
- Grid pattern for alignment of objects
This is a public domain screen drawing program, you may copy it without
guilt but if you use it much, and especially if you want it to improve,
please send me $15.00 and I will register you as a user and inform you when
new versions become available. My address is:
Stephen Vermeulen
3635 Utah Dr., N.W.,
Calgary, Alberta,
CANADA, T2N 4A6
My phone is: (403)-282-7990, best time to call is 16:00 - 23:00.
Registered users will also get a photocopy of a more detailled manual when it
becomes available. And if you want to receive updates of the program as
soon as they become available (and you are a registered user) send me a
blank disk and $1.50 and I will mail the update to you as soon as it becomes
available. You can include a note as to how much upgrading you wish to see
in the new version, for example "wait for a major new feature like 'line'",
"wait for a new plotter driver", "when you have done 30 hours of changes",
etc.
Also if you are a registered user, feel free to send me your comments and
suggestions!
Vdraw now supports super bit map scrolling of the drawing window. The
actual size of the super bit map is defined in the vdraw.profile file that
should be located within your S: logical device. To setup the default
vdraw.profile type:
copy xxx:vdraw.profile s:
where xxx: is the name of the device which the vdraw program is on (probably
either df0: or df1:). The vdraw.profile file contains the following data:
2.277
704 300
10 10 0
7 -11
50000
200 1
The first number "2.277" is the aspect ratio for your screen, this is used
to scale the drawing of circles so that they appear round. To calculate
this use the formula:
(measured height of the screen) 640
------------------------------- x ------------------------------
200 (measured width of the screen)
The next two numbers are the width and height of the super bit map to use.
If you have a 2Meg Amiga (lucky you!) you can make these as large as 1000
by 750, (maybe even larger), if you are calculating how much memory is going
to be used by the super bit map you have three planes rather than the two
you might expect because of the TempRas needed by the Flood area filler.
The next two numbers are the coordinates of the top left corner of the
drawing window on the screen, note because of a bug in Intuition (I think)
you cannot drag a superbitmap window around without loosing data from it,
because of this I have turned the draging off for this release, I hope
version 1.2 of the Kickstart disk fixes this. I have tested vdraw with
1.2 Beta 2 release of kickstart and it appears that this bug has been
fixed, so what I have done is given you a flag (the third number on this
line) that allows you to disable/enable dragging of the drawing window
depending on whether you have 1.1 or 1.2. To disable dragging set this
to a zero (0) while to enable dragging set this to one (1).
The next two numbers specify the initial size for arrowheads, the second
number being negative is a result of the Amiga's reversed Y axis coordinate
system. The next number in the file is the time (in microseconds) between
refreshes of the lens window. To make the lens window respond more
quickly to things you are doing in the main window you reduce this value,
to slow the lens' response (and speed up the main program) you increase
this number. The maximum value is 999999 and the minimum value is probably
around 20000. (The lens is the little untitled window that shows a
magnified view (black and white only) of the pixels near the mouse
pointer. The last two numbers are the vertical screen resolution to use
(either 200 or 400 lines) and the number of bit planes to allocate for
colours (1, 2, or 3 bit planes corresponding to 2, 4, or 8 colours).
Note: the 704 above is a bit special, you must make sure that whatever
number you pick is exactly divisible by 16. ( ie 704 = 16x44 )
How to compute the memory used for bit map data by Vdraw:
number of planes * width * height
number of bytes = ---------------------------------
8
(Note: for a workbench screen (4 colours) number of planes = 2
and Vdraw 1.06+ has its own area filling routine and thus
does not need an extra bit plane for temporary Flood()
routine use. Older Vdraws and some commercial drawing
programs use an extra plane which wastes memory. )
-------- VDRAW --------
Vdraw is menu driven and easy to use. To start you select a pen colour from
the Graphics menu. Then you select a drawing mode from the Draw menu.
The drawing modes that now exist are:
NOTE: To escape from any function that changes the
window's title (ie Sketch, areafill...) just
press the menu button.
HOLLOWBOX - Draws a series of hollow boxes. Press the menu button
to leave this mode. The boxes are drawn in the current
line type as selected in the Graphics menu.
FILLEDBOX - Draws filled boxes. Uses the currently selected area
type to do the fills. Menu button exits. Currently does
not draw a border around the rectangle, this may be added
in a future release.
SKETCH - Sketch lines on the screen while the SELECT button is pressed
press the MENU button to exit.
LINE DRAW - This routine gives you complete, fine control of drawing
single lines. You click on the START / END gadget to
select the end point of the line to be moved. You then
either click in the main drawing window or click on one of
the control window's arrow gadgets to move the selected
end point of the line. If you want arrow heads (for
dimension lines) you may click on the NONE/ONE/TWO gadget,
clicking cycles through the options of no arrow heads, an
arrow head on the END point and arrowheads at both ends.
The HOLLOW/SOLID gadget is provided for a future release
which will allow HOLLOW (as now) or SOLID arrowheads.
To change the size/shape of the arrow head, click on the
A SIZE gadget then click on the 4 arrow gadgets to return
these to their normal functions click on the A SIZE gadget
again. When you are satisfied
with the appearance of the line press the OK gadget. To
finish drawing lines click the CANCEL gadget.
CAUTION: it seems that scrolling the superbitmap much while
drawing lines can leave junk on the screen, it shouldn't
but I suspect a bug in Layers or Intuition, any comments?
The above is definintly a bug in 1.1 Kickstart, it has
been fixed in 1.2!
CIRCLE - This routine allows versatile drawing of circles. With
circles you are either adjusting the RADIUS or are locating
the CENTER of the circle. Click on the RADIUS and CENTER
gadgets to choose which mode you are in. You can use either
the arrow gadgets or click directly in the drawing window
to adjust either the position or radius length. The MARK
gadget controls whether the crosshair mark at the center
of the circle is drawn or not. Note: to get round circles
on either the screen or the printer you can play around
with the aspect ratio (the first number in the
vdraw.profile file). Also note that if a circle is
round on the screen and you print it with the AUTOSIZED
printing option it will be round on the printer as well.
ARC-SECTOR -Use this mode to draw circular arcs or pie-pieces (for
pie charts). This mode extends the CIRCLE mode by adding
several gadgets, the ARC and SECTOR gadgets allow you to
switch between these two modes, and the START and END
gadgets allow you to adjust the angular sweep of the arc
or sector. Again the START and END positions may be
adjusted either by clicking in the drawing window or by
pressing one of the arrow gadgets.
AREAFILL - Move the pointer to the area to be filled and press the
select button to fill the area. MENU button exits. Use
the Graphics menu to select the fill pattern to be used,
currently there are 60 patterns, hence the need for two
Area Types entries. The area filling is now done by my
own routine, rather than by a call to the graphics
library, the reason I did this was that the Flood()
command needs an extra bit plane, and that can waste a
lot of memory! This routine is slightly slower, but you
do get to see it work (so you know the system has not
crashed), and can run out of buffer memory (but will not
crash if it does so). I would be interested in hearing
how much of the fill buffer is actually used (I print
a message in the dos window to keep you informed of this).
I could also speed up this routine some what by coding
a special version of ReadPixel(), but I will have to
receive a few requests before I try this...
TYPE TEXT - Allows you to enter a string of text, edit it, select
the drawing mode (JAM1 ...) and style (bold face ...)
to be used and then position the text exactly on the
screen. When positioning the text you may either use
the arrow gadgets (click once to move one pixel, hold
down for automatic repeat) or click directly in the
drawing window. When the final version of the text
has been drawn the routine will try and do a carriage
return line feed to align the next line of text with
the left edge of the previous text. Two bugs in moving
text have been fixed.
The GRAPHICS menu has the following topics:
SCREEN - This item has not been implemented yet, eventually I would
like to be able to select the graphic resolution that is to
be used here and then have the system resize everything to
fit. Especially useful would be the ability to get the 400
line interlace mode working from here. Note: at the moment
the only way to change the screen resolution is by the
values in the vdraw.profile file, but, at least you can
now do it.
COLOURS - This item allows you to select the current drawing pen
colour. If you are drawing (especially area filling!) and
do not see anything go on the screen it is probably because
you selected the background colour as the pen colour.
CHANGE COLOUR - This item which has not been added yet will let you do
the RGB mixing of your palate. For the moment, for 2 and
4 colour screens you can use preferences. If anyone has
code for a RGB mixer (like in preferences) I could include
it in Vdraw, hint, Hint, HINT...
LINE TYPES - Currently this item lets you select from 16 different line
patterns, I know they are a bit difficult to read as of yet
but this is a low priority to change. If you can think of
as 16 bit sequence I have missed that would be useful here
send it to me.
AREA TYPES - Two items here, 1 and 2, because Amiga only supports up to
31 Sub Items for a given Item in a menu list. These are the
lifesize predefined area fill patterns. There are probably
some good ones that I have missed (if so let me know). I
would also like to add some way of user editing these in a
future release.
There is an EDIT menu, the following functions are supported:
MAGNIFY - Draw an enlarged view of a 16x12 pixel region on the screen.
To magnify a different area, point at it and press the
SELECT button. A small rectangle shows the area that is
being magnified. To change a single pixel, point at it in
the magnify window and press the SELECT button, each press
cycles the pixel's colour by one. To finish magnifing
close the magnify window. To scroll the magnified view
click on the arrow icons in the Magnify window.
CUT - This option allows you to make a copy of a rectangular area
in the FREEDRAW WINDOW, the copy appears in the CUT window.
The CUT window sizes automatically to accept the cut image.
To return to the main menu press the MENU button.
PASTE - This option allows you to paste the contents of the CUT
window anywhere in the FREEDRAW window. There are four
modes in which you can do the actual pasting. When you are
done press the MENU button. The two most useful modes are
overlay (which erases the area underneath the patch being
pasted) and OR which does a logical OR of the two areas.
The MERGE does an exclusive or of the areas and the seive
is really wierd!
INVERSE - This routine inverts the colours in the selected area. Press
the MENU button to exit.
ERASE - This routine lets you either erase the entire drawing surface
or enter a special erase box mode which allows you to
specify (by rubber banding a box) a series of rectangular
areas on the drawing surface to be erased.
MOVE - This routine lets you box an area on the screen, cut it out
(erasing the area where it was) and move it somewhere else.
The mode which is used to paste down the final copy is one
of the four modes that the PASTE function supports, the
normal mode to use is "OR".
GRID - This menu topic has three subitems, ON, OFF, and PITCH.
Selecting ON will turn the background alignment grid
pattern on. Selecting OFF turns it off. And selecting
PITCH will pop up a window asking you to type in a pitch
to be used. When this window appears, click on the string
requester, and type in your desired pitch as two integer
numbers separated by a space, for example: "50 50".
Then, either hit return or click on the OK gadget.
The OPPS menu allows you to select system type operations, these are
relatively bug free, however they are very new. You can print either
the entire drawing surface (PRINT ALL) or just what is displayed on the
window (PRINT WINDOW). Either printing may be done as a one to one pixel
dump (in which case the circles get squished) or as a autosized remapping
in which case the aspect ratios stay correct. Due to a request from one
of the registered users I have added 2:1, 3:1, 4:1, and 5:1 options to
these printing functions, these will double (or tripple, or quadruple...)
the size of the pixels on the printer, and they break up the printing
into n*n pieces of paper, so that very large posters (40 by 50 inches)
can be produced. To make this work the best you should set the size of
the super bit map (in vdraw.profile remember?) so that your printer does
its automatic perforation skip at the end of a 1:1 bitmap dump. On my
Roland PR-1011 (Epson printer driver) I set the super bit map to be
960 pixels wide by 720 lines high, this exactly fills a full page on the
printer, thus the 4:1 option gives you a poster made of 16 complete 8.5x11
sheets of paper!
Finally you can save your
drawing with SAVE FILE or load a previous effort with LOAD FILE.
There are two submenu topics for these: VDRAW and IFF, select the VDRAW
option to load/save the file is Vdraw bitmap format, the IFF option is
provided for a future release where it will allow loading/saving of files
in the IFF format. These routines do not use the IFF format, this is
because I do not have enough documentation or examples to figure it out
yet (maybe version 1.2?). Finally I have added an audit file option. The
purpose behind this is to generate a file of ascii commands that could be
used to drive a plotter or laser printer to create very high quality output.
Since the audit file is a completely ascii format it can be edited with
any text editor, easily transmitted by modem and it might even take less
space than a bit map.
There are four submenu topics for the AUDIT topic. The first is ON which is
used to open a file for recording commands, it will ask you for a file name
in a special window. If you plan on using the SKETCH draw mode I would
recomend you specify that the audit file is on the ram disk! If you only
have a single drive system and you want to use several fonts you MUST put
the audit file on the ram disk because the system can get confused when
trying to load a font and the audit file is open! The OFF sub menu topic is
used to close the audit file. You could then open another audit file to
record a new drawing without leaving Vdraw. The PLAYBACK topic is used to
play an existing audit file back into Vdraw, it will ask for the file name
in a special window. With this feature is is possible to edit a drawing
by using a text editor to edit an audit file and then PLAYBACK the edited
audit file. The last submenu topic is the MACRO feature which allows one to
replay an audit file relative to the mouse pointer's position (like the way
the PASTE option works), this feature can be used to create a "parts"
library. To use it select the MACRO topic, then enter the file name to be
replayed in the special window
next click in the main drawing window (the first click is wasted currently
to get the mouse propperly in position) next, click wherever you wish a
copy of the part to be drawn. When you are done press the menu button to
leave this mode. The LOADCUT and SAVECUT routines have not yet been
implemented, these will allow the loading and saving of the cut window in
iff file format. The QUIT option is the way out of the program.
The FONTS menu allows you to select the font to be used in subsequent text
commands. This menu is not fixed, instead it is dynamically built when the
program is run so that all the fonts currently in the system are supported.
Currently a maximum of 100 combinations of font and point size are
supported, this will probably be rewritten in a future release.
The CREDITS menu prints the author credits.
The author of Freedraw 0.01 gets credit here because the very original
version of this was based on Freedraw 0.01, over time the old code has
been transformed beyond recognition and now, statistically may account
for up to 0.3% of the source code, if it can be recognized!
PLOTTER drivers:
Support for Hewlett Packard XY plotters has been added in the form of
a special file conversion utility that converts from Vdraw audit file
commands to Hewlett Packard's HPGL language. It also appears that the
Roland plotters may use this command language, but I have not personally
tested this. It appears that there are at least 3 versions of HPGL in existance
I have used the very earliest two in the writing of the driver. The first
version supports line drawing and text, the second version adds commands
to draw circles and arcs, and the third version supports some area filling
(of circles, sectors, and rectangles). As each new version of HPGL includes
all the commands of the previous version the driver will work on any plotter
with any version of HPGL. The steps to produce a Vdraw drawing on an HPGL
plotter are as follows:
1 - Start Vdraw, open an audit file
2 - Draw your drawing, keep in mind that the plotter driver cannot
handle such things as paste, erase, magnify ... The driver only
has one font, but it does have a variable height and supports
underlining, bold facing, extended width, and italics.
3 - When you have finished drawing close the audit file and leave Vdraw.
4 - Now you will need to use the "hpout" program to convert the audit
file commands to an HPGL file. To use this program you need one
more file which contains information about the plotter you are using
an example of this file called "guide" is located in the "plotters"
directory along with the "hpout" program. The "guide" file contains
the following information:
10
0.035
500 500
7220
the first line specifies the magnifing factor to convert from Vdraw
coordinates to plotter coordinates (this may be a real number, ie.
you could use something like 5.26), you use this number to set the
final size of the drawing. The second line contains the magnifing
factor for text. The third line contains the global paper offsets
in plotter coordinates, you can use these numbers to shift the plot
around on the page (no decimals are allowed here). The fourth number
contains the plotter's model number, this is used by the driver to
find out what version of HPGL the plotter understands. Do not include
any letters on this line, that is specify 7220 even if you have a
plotter HP calls a 7220T. The only two models that are accepted at
the moment are the 7220 and the 7475, both of these will use level
two of HPGL, if you want to use the very primative level of HPGL
specify a 9872 plotter. As I did not have full documentation on the
7475 I was not able to make use of its additional area filling
commands at this point in time.
5 - To use the hpout program, call it from CLI by "hpout", this way the
the program will remind you that the actual syntax to use is:
hpout guide auditfile hpglfile
and will cause the program "hpout" to read the plotter information
file called "guide" and use that information to help convert the
file "auditfile" containing the Vdraw drawing audit commands into
a file called "hpglfile" containing the drawing in HPGL format.
NOTE: any audit commands (such as FILL, CUT, PASTE ...) that the
plotter cannot handle will be ignored by the hpout program
and will not appear in the hpglfile.
6 - Finally, (about time you say?) you can draw the drawing on your
plotter by copying it to the appropriate port (either PAR: or SER:)
that is:
copy hpglfile PAR: or copy hpglfile SER:
I would not try to use PRT: because there is a chance that the special
reformating that the Amiga's printer driver does might interfere with
the format of the HPGL plotter commands.
7 - If you need to modify the program "hpout" to support other plotters
(or even laser printers) the source code is provided in "hpout.c",
if you do this please send me the modified source code so that I can
redistribute it.
Stephen Vermeulen 7-Aug-1986.
UPCOMING ideas:
- saving/loading of the drawing in IFF.H format
- drafting aids, more area fill patterns.
- perhaps a CHARTS menu for doing canned graphs, like bar graphs and
pie charts... ideas??
- a SCREEN menu to allow you to use a variety of graphics resolutions,
640x400, 320x200x32 etc.
- a COLOUR PALATE window to allow you to change the colours.
- more plotter drivers that would take an audit file as input and create
an output file suitable for driving various plotting devices such as
laser printers and XY plotters.
- faster moving routine.
- spray painting, brushing...
- drop me a line if you have any requests.
- Wanted: source code I can add to Vdraw for an RGB colour mixer
and examples of reading/writing the IFF files!
(Must be fully public domain!)