home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / AUTOGR.ZIP / README.AG < prev   
Encoding:
Text File  |  1989-11-06  |  13.3 KB  |  264 lines

  1.                      AUTOGRAPHIC.
  2.  
  3.  
  4.                      What you need.
  5.  
  6.  In order to use AutoGraphic, you must have a MicroSoft or very
  7. MicroSoft-compatible Mouse and driver version 6.11 or above seems to work. If
  8. you experience problems try a more recent mouse driver. Some users have
  9. reported problems with mice which purport to be MicroSoft compatible but are
  10. not.  In addition you will need a VGA, colour EGA, CGA or Hercules screen.  If
  11. you use it on a Hercules  screen, I would suggest that you do all your drawing
  12. in the default colour.    Drawing in other colours can produce problems on
  13. certain Hercules screens.
  14.  
  15.  I originally developed AutoGraphic to create graphical images with Turbo
  16. Pascal.
  17.  
  18.  AutoGraphic allows you to create images on the screen, at the same time it
  19. generates the code necessary to describe your picture in Turbo Pascal.
  20.  
  21.  I looked at lots of other graphical packages, but couldn't find one which
  22. allowed me to generate images which could easily (and compactly) be
  23. incorporated into my Turbo Pascal programs; so I wrote this one.
  24.  
  25.  I would never pretend that AutoGraphic is as sophisticated as some graphics
  26. packages, but then it was never intended to be.  It started life as a simple
  27. package for drawing outlines and I found it so useful that I just kept on
  28. adding new features.
  29.  
  30.  
  31.                    Installing AutoGraphic.
  32.  
  33.  
  34.  AutoGraphic is intended to work with the computer language Turbo Pascal
  35. (Version 4.0 and above).
  36.  
  37.  I am assuming that you have a suitable copy of Turbo Pascal and that you have
  38. already installed it.  This installation process is described in the Turbo
  39. Pascal User's Guide, chapter 1.
  40.  
  41.  AutoGraphic needs to be able to get at some of Turbo Pascal's *.BGI and *.CHR
  42. files in order to run.    These are distributed with AutoGraphic but owners of
  43. Turbo Pascal will presumably already have them in their Turbo Pascal directory.
  44. Such people only need to copy AG.EXE and the *.PAS files into the same
  45. directory.  People without Turbo Pascal should copy all of the files which came
  46. along with AutoGraphic into a separate directory or floppy disk and run it from
  47. there.
  48.   
  49.                    Creating Drawings.
  50.  
  51.  When you start up AutoGraphic you will be asked whether you wish to start a
  52. new drawing or add to an existing one. Clearly for your first attempt, you will
  53. elect to create a new drawing.
  54.  
  55.  Next you will be asked for the name of a file.  This is the file in which the
  56. Turbo Pascal code describing your picture will be stored.  After this you will
  57. be presented with a menu which enables you to start drawing.  The menu will
  58. appear on the left-hand side of the screen and consists of a series of boxes.
  59. Each box can be used by placing the mouse cursor on it and clicking the left
  60. hand mouse button.
  61.   
  62.  If you haven't already done so, why not load up AutoGraphic now and try the
  63. boxes as they are described (assuming that you have printed this manual!)?
  64.  
  65.  The arrow symbol in the top box allows you to move the whole menu from side to
  66. side of the screen.  Clicking the left hand mouse button in this square will
  67. move the menu to the other side of the screen.
  68.  
  69.  I designed AutoGraphic so that I could draw anywhere on the screen.  An
  70. immediate problem arose; no matter where I put the menu, it was bound to get in
  71. the way eventually. So I made the menu movable.  If you work on the left hand
  72. side of the screen, I strongly recommend that you move the menu to the
  73. right-hand side and vice versa.  If you don't, you won't be able to see what
  74. you are doing, and you may get some odd effects when you try to fill shapes
  75. which lie under the menu.
  76.  
  77.  The next square down allows you to draw rectangles on the screen.  Click and
  78. release the LHB (Left hand button) on this square and then move into the middle
  79. of the screen. Click and release the LHB and move the mouse.  You should have a
  80. rectangle which you can expand and contract by moving the mouse around.  When
  81. it is the correct size, click and release the LHB.  You can now start another
  82. rectangle, simply by moving the mouse to a new location and clicking and
  83. releasing the LHB.  Finish it as before.
  84.  
  85.  You can continue to draw as many rectangles as you like. Clicking the LHB on
  86. one of the other options in the menu, will enable you to choose that option.
  87.  
  88.  Below the rectangle is the option to allow you to draw circles.  This works in
  89. much the same way as drawing rectangles.
  90.  
  91.  The next option down allows you to draw lines.  Click the LHB on this square,
  92. move the mouse cursor to the starting location of the line you want to draw and
  93. click and release the LHB.  As you move the cursor, the line will follow the
  94. cursor.  Press and release the LHB to fix a point on the line, and you can
  95. continue to draw the same line, anchoring points with the LHB.    To finish a
  96. particular line, press the RHB (Right Hand Button).  Another line can be
  97. started by again pressing the LHB.
  98.  
  99.  The next option allows you to select the colours in which you can draw and
  100. fill.  Clicking on this box will cause your drawing to vanish and be replaced
  101. by a different menu. This menu allows you to select three things; the colour in
  102. which you draw and the colour and pattern with which you can fill shapes.  The
  103. top row is the colour in which you draw.  Try clicking the LHB on some of the
  104. options.  You will notice that each one that you select becomes outlined (you
  105. may notice other changes taking place at the same time, but ignore these for a
  106. moment.)  As mentioned above, if you are using a Hercules screen, it is safer
  107. to stick to the default colour which is White.
  108.  
  109.  If you now click on the Exit box you will return to the drawing.  Try drawing
  110. another rectangle and you will see that you are drawing in the colour that your
  111. selected.
  112.  
  113.  Now click on the box labelled Fill.  Then move the mouse cursor into the
  114. inside of the rectangle that you have drawn and click and release the LHB.  You
  115. should find that the rectangle fills with the colour in which you have drawn.
  116.  
  117.  Clearly we normally want to fill a shape in the same colour as it is drawn, so
  118. when you select a drawing colour, the fill colour is changed to the identical
  119. colour.  Click on the square below the line option again and see this working.
  120. As you select a drawing colour, the fill colour (in the middle section of the
  121. screen) is updated.
  122.  
  123.  Sometimes, you may want to draw in one colour and fill that shape in a
  124. different colour.  In this case select the draw colour first, and then select
  125. the fill colour.
  126.  
  127.  
  128.  The lower part of the screen allows you to select the pattern with which the
  129. fill is performed, try selecting some of these.  The square just above the
  130. 'Exit' square shows, in a composite form, all of the selections that you have
  131. made.
  132.  
  133.  If you Exit from the selection menu, we can look at the rest of the menu
  134. options.
  135.  
  136.  Below the Fill box is one called Undo.  If you are like me, you will make
  137. mistakes.  AutoGraphic holds (at least) the last 25 drawing instructions that
  138. you have issued.  You can remove them in reverse order by clicking the LHB on
  139. the Undo box.  Nothing will appear to happen until you click on the Redraw box.
  140. This enables you to rapidly remove several commands by clicking on the Undo box
  141. several times before asking for a Redraw.
  142.  
  143.  Redraw should also be used if your drawing becomes untidy. This can happen,
  144.  particularly if you use the Circle, since it tends to 'eat away' other images.
  145.  Just click on this box to redraw your picture from start to finish.  It is
  146.  often advisable to redraw before using Fill, because the fill colour will leak
  147.  out if the line around the area being filled is not complete.
  148.  
  149.  The Save option transfers all of your work so far to the disk file.  At any
  150. one time, AutoGraphic holds between 25 and 49 of your drawing instructions in
  151. the computer's memory.  As the number increases, blocks of 25 commands are
  152. written to the disk file.  The ones which remain in memory are the ones which
  153. you can Undo.  The save option transfers everything from memory to disk.  Your
  154. work is then safe, but you cannot Undo any commands issued before the Save.
  155. Since AutoGraphic will do a save every 25 commands, this option is not one that
  156. you will need to use very often.
  157.  
  158.  The final option allows you to leave your drawing. AutoGraphic automatically
  159. saves your work when you exit, so if there is anything that you don't like,
  160. remember to Undo before exiting.
  161.  
  162.  AutoGraphic will ask you if you want to do another drawing and, if so, will
  163. start again.
  164.  
  165.              Using drawings in a Pascal program.
  166.  
  167.  Once you have created a drawing, you will want to incorporate it into a Turbo
  168. Pascal program.  Suppose that you entered the name FISH when AutoGraphic asked
  169. you for a file name.  There should now be a file called FISH.PAS on the disk.
  170. I have provided a file called PENGUIN.PAS with AutoGraphic.  It is a very
  171. simple program which incorporates a section of code produced by AutoGraphic.
  172.  
  173.  As you can see the procedure called 'Picture' is a self contained unit which
  174. displays a drawing.  You can incorporate drawings into your programs as answers
  175. to questions, as parts of questions, to illustrate a point; they have a
  176. multitude of uses.
  177.  
  178.  
  179.       Notes on the code produced by AutoGraphic.
  180.  
  181.  The code produced by AutoGraphic is very similar to the normal code used in
  182. Turbo Pascal to describe images.  The only difference is that all the numbers
  183. are between 0 and 100.
  184.  
  185.  Normally Turbo Pascal uses entries like :-
  186.  Circle(148,31,3);
  187.  
  188.  which means draw a circle at location 148,31 with a radius of 3.  Where is
  189. 148,31 you ask?   The answer is that it depends which screen you are using.
  190. This is a problem because if you write a program on a machine with, say, a VGA
  191. screen, your drawings will be unusable on an EGA screen.
  192.  
  193.  To overcome this, I have included two functions (XX and YY).  You will find
  194. them in PENGUIN.PAS.  These find out what sort of screen your computer has, and
  195. adjusts the picture size accordingly.  So if you use AutoGraphic on a VGA
  196. machine, the pictures you produce will work fine on an EGA.  In addition, you
  197. get a much better idea of roughly where drawings are on the screen when you
  198. look at the code.
  199.  
  200.  The middle of the screen is XX(50),YY(50)
  201.  top left is XX(0),YY(0)
  202.  bottom left is XX(0),YY(100)
  203.  bottom right is XX(100),YY(100). 
  204.  
  205.  In addition to XX and YY, I have included another routine, StartGraphics which
  206. gets the graphics up and running.
  207.   
  208.             Notes on using AutoGraphic.
  209.  
  210.  A problem can arise if you produce drawings on one machine, and then run
  211. programs which incorporate these drawings on another machine with a different
  212. screen resolution.  The Fill option will fill an area neatly (without 'leaking
  213. out') only if the area is completely enclosed.  This is not a problem with
  214. complete circles and rectangles because they are unbroken.
  215.  
  216.  However, suppose you use the 'line-draw' option to enclose an area prior to
  217. filling and that you take care to close up the area properly.  This area may
  218. then fill properly in, say, EGA.  However when you run this same code on a
  219. machine with VGA, the higher resolution of the VGA screen may mean that a tiny
  220. gap exists between the beginning of the line and the end.  You may find that
  221. the colour leaks out when the fill operation takes place.
  222.  
  223.  There are two obvious solutions to this problem.  The first is to do your
  224. drawing on a high resolution screen; I do all of mine on a VGA screen.    The
  225. other is to make sure that you overlap the ends of lines very slightly if you
  226. are going to use the fill option with that line.
  227.  
  228.  Above all, practice with AutoGraphic. I hope that you find it as much fun to
  229. use as I have done.
  230.                   
  231.        Using AutoGraphic with a Laser Disc Player.
  232.  
  233.  If you are lucky enough to have a laser disc player which is controlled via a
  234. MIC card, then you can draw pictures directly on top of a video image.    In
  235. fact, this was one of the main reasons that AutoGraphic was developed and this
  236. explains why I was so obsessed with making sure that we could draw anywhere on
  237. the screen.  No matter where I put the menu, someone found a video image where
  238. the menu sat on top of an important part of the image.
  239.  
  240.  It is perfectly possible to set up the laser player 'manually' using the MIC
  241. commands.  However, to make life easy there are two tiny programs LASERON and
  242. LASEROFF which make the job easier.  Suppose that you wish to draw on top of
  243. the 23432 frame on a laser disc.  Turn on the laser player and put in the laser
  244. disc.  Make sure that you are in the correct subdirectory to use AutoGraphic
  245. (see above) and type LASERON and press the Enter key.  You will be asked which
  246. frame number you want to use, type in 23432 and press the Enter key.  LASERON
  247. will wake up the laser player, find that frame and display it on the screen as
  248. a still.  Then you can run AutoGraphic and draw on top of the still.  Once you
  249. have finished, you must run the program called LASEROFF which shuts down the
  250. connection to the laser player.
  251.  
  252.  Further details are available from :-
  253.  
  254.                 Mark Whitehorn.
  255.                 Easterton,
  256.                 By Monikie,
  257.                 Broughty Ferry,
  258.                 Dundee.  DD1 4HN.
  259.                 Scotland.
  260.  
  261.  Turbo Pascal and all Borland products are trade marks or registered trade
  262. marks of Borland International inc. 1983-1989 or Borland\Analytica.
  263.   
  264.