home *** CD-ROM | disk | FTP | other *** search
- AUTOGRAPHIC.
-
-
- What you need.
-
- In order to use AutoGraphic, you must have a MicroSoft or very
- MicroSoft-compatible Mouse and driver version 6.11 or above seems to work. If
- you experience problems try a more recent mouse driver. Some users have
- reported problems with mice which purport to be MicroSoft compatible but are
- not. In addition you will need a VGA, colour EGA, CGA or Hercules screen. If
- you use it on a Hercules screen, I would suggest that you do all your drawing
- in the default colour. Drawing in other colours can produce problems on
- certain Hercules screens.
-
- I originally developed AutoGraphic to create graphical images with Turbo
- Pascal.
-
- AutoGraphic allows you to create images on the screen, at the same time it
- generates the code necessary to describe your picture in Turbo Pascal.
-
- I looked at lots of other graphical packages, but couldn't find one which
- allowed me to generate images which could easily (and compactly) be
- incorporated into my Turbo Pascal programs; so I wrote this one.
-
- I would never pretend that AutoGraphic is as sophisticated as some graphics
- packages, but then it was never intended to be. It started life as a simple
- package for drawing outlines and I found it so useful that I just kept on
- adding new features.
-
-
- Installing AutoGraphic.
-
-
- AutoGraphic is intended to work with the computer language Turbo Pascal
- (Version 4.0 and above).
-
- I am assuming that you have a suitable copy of Turbo Pascal and that you have
- already installed it. This installation process is described in the Turbo
- Pascal User's Guide, chapter 1.
-
- AutoGraphic needs to be able to get at some of Turbo Pascal's *.BGI and *.CHR
- files in order to run. These are distributed with AutoGraphic but owners of
- Turbo Pascal will presumably already have them in their Turbo Pascal directory.
- Such people only need to copy AG.EXE and the *.PAS files into the same
- directory. People without Turbo Pascal should copy all of the files which came
- along with AutoGraphic into a separate directory or floppy disk and run it from
- there.
-
- Creating Drawings.
-
- When you start up AutoGraphic you will be asked whether you wish to start a
- new drawing or add to an existing one. Clearly for your first attempt, you will
- elect to create a new drawing.
-
- Next you will be asked for the name of a file. This is the file in which the
- Turbo Pascal code describing your picture will be stored. After this you will
- be presented with a menu which enables you to start drawing. The menu will
- appear on the left-hand side of the screen and consists of a series of boxes.
- Each box can be used by placing the mouse cursor on it and clicking the left
- hand mouse button.
-
- If you haven't already done so, why not load up AutoGraphic now and try the
- boxes as they are described (assuming that you have printed this manual!)?
-
- The arrow symbol in the top box allows you to move the whole menu from side to
- side of the screen. Clicking the left hand mouse button in this square will
- move the menu to the other side of the screen.
-
- I designed AutoGraphic so that I could draw anywhere on the screen. An
- immediate problem arose; no matter where I put the menu, it was bound to get in
- the way eventually. So I made the menu movable. If you work on the left hand
- side of the screen, I strongly recommend that you move the menu to the
- right-hand side and vice versa. If you don't, you won't be able to see what
- you are doing, and you may get some odd effects when you try to fill shapes
- which lie under the menu.
-
- The next square down allows you to draw rectangles on the screen. Click and
- release the LHB (Left hand button) on this square and then move into the middle
- of the screen. Click and release the LHB and move the mouse. You should have a
- rectangle which you can expand and contract by moving the mouse around. When
- it is the correct size, click and release the LHB. You can now start another
- rectangle, simply by moving the mouse to a new location and clicking and
- releasing the LHB. Finish it as before.
-
- You can continue to draw as many rectangles as you like. Clicking the LHB on
- one of the other options in the menu, will enable you to choose that option.
-
- Below the rectangle is the option to allow you to draw circles. This works in
- much the same way as drawing rectangles.
-
- The next option down allows you to draw lines. Click the LHB on this square,
- move the mouse cursor to the starting location of the line you want to draw and
- click and release the LHB. As you move the cursor, the line will follow the
- cursor. Press and release the LHB to fix a point on the line, and you can
- continue to draw the same line, anchoring points with the LHB. To finish a
- particular line, press the RHB (Right Hand Button). Another line can be
- started by again pressing the LHB.
-
- The next option allows you to select the colours in which you can draw and
- fill. Clicking on this box will cause your drawing to vanish and be replaced
- by a different menu. This menu allows you to select three things; the colour in
- which you draw and the colour and pattern with which you can fill shapes. The
- top row is the colour in which you draw. Try clicking the LHB on some of the
- options. You will notice that each one that you select becomes outlined (you
- may notice other changes taking place at the same time, but ignore these for a
- moment.) As mentioned above, if you are using a Hercules screen, it is safer
- to stick to the default colour which is White.
-
- If you now click on the Exit box you will return to the drawing. Try drawing
- another rectangle and you will see that you are drawing in the colour that your
- selected.
-
- Now click on the box labelled Fill. Then move the mouse cursor into the
- inside of the rectangle that you have drawn and click and release the LHB. You
- should find that the rectangle fills with the colour in which you have drawn.
-
- Clearly we normally want to fill a shape in the same colour as it is drawn, so
- when you select a drawing colour, the fill colour is changed to the identical
- colour. Click on the square below the line option again and see this working.
- As you select a drawing colour, the fill colour (in the middle section of the
- screen) is updated.
-
- Sometimes, you may want to draw in one colour and fill that shape in a
- different colour. In this case select the draw colour first, and then select
- the fill colour.
-
-
- The lower part of the screen allows you to select the pattern with which the
- fill is performed, try selecting some of these. The square just above the
- 'Exit' square shows, in a composite form, all of the selections that you have
- made.
-
- If you Exit from the selection menu, we can look at the rest of the menu
- options.
-
- Below the Fill box is one called Undo. If you are like me, you will make
- mistakes. AutoGraphic holds (at least) the last 25 drawing instructions that
- you have issued. You can remove them in reverse order by clicking the LHB on
- the Undo box. Nothing will appear to happen until you click on the Redraw box.
- This enables you to rapidly remove several commands by clicking on the Undo box
- several times before asking for a Redraw.
-
- Redraw should also be used if your drawing becomes untidy. This can happen,
- particularly if you use the Circle, since it tends to 'eat away' other images.
- Just click on this box to redraw your picture from start to finish. It is
- often advisable to redraw before using Fill, because the fill colour will leak
- out if the line around the area being filled is not complete.
-
- The Save option transfers all of your work so far to the disk file. At any
- one time, AutoGraphic holds between 25 and 49 of your drawing instructions in
- the computer's memory. As the number increases, blocks of 25 commands are
- written to the disk file. The ones which remain in memory are the ones which
- you can Undo. The save option transfers everything from memory to disk. Your
- work is then safe, but you cannot Undo any commands issued before the Save.
- Since AutoGraphic will do a save every 25 commands, this option is not one that
- you will need to use very often.
-
- The final option allows you to leave your drawing. AutoGraphic automatically
- saves your work when you exit, so if there is anything that you don't like,
- remember to Undo before exiting.
-
- AutoGraphic will ask you if you want to do another drawing and, if so, will
- start again.
-
- Using drawings in a Pascal program.
-
- Once you have created a drawing, you will want to incorporate it into a Turbo
- Pascal program. Suppose that you entered the name FISH when AutoGraphic asked
- you for a file name. There should now be a file called FISH.PAS on the disk.
- I have provided a file called PENGUIN.PAS with AutoGraphic. It is a very
- simple program which incorporates a section of code produced by AutoGraphic.
-
- As you can see the procedure called 'Picture' is a self contained unit which
- displays a drawing. You can incorporate drawings into your programs as answers
- to questions, as parts of questions, to illustrate a point; they have a
- multitude of uses.
-
-
- Notes on the code produced by AutoGraphic.
-
- The code produced by AutoGraphic is very similar to the normal code used in
- Turbo Pascal to describe images. The only difference is that all the numbers
- are between 0 and 100.
-
- Normally Turbo Pascal uses entries like :-
- Circle(148,31,3);
-
- which means draw a circle at location 148,31 with a radius of 3. Where is
- 148,31 you ask? The answer is that it depends which screen you are using.
- This is a problem because if you write a program on a machine with, say, a VGA
- screen, your drawings will be unusable on an EGA screen.
-
- To overcome this, I have included two functions (XX and YY). You will find
- them in PENGUIN.PAS. These find out what sort of screen your computer has, and
- adjusts the picture size accordingly. So if you use AutoGraphic on a VGA
- machine, the pictures you produce will work fine on an EGA. In addition, you
- get a much better idea of roughly where drawings are on the screen when you
- look at the code.
-
- The middle of the screen is XX(50),YY(50)
- top left is XX(0),YY(0)
- bottom left is XX(0),YY(100)
- bottom right is XX(100),YY(100).
-
- In addition to XX and YY, I have included another routine, StartGraphics which
- gets the graphics up and running.
-
- Notes on using AutoGraphic.
-
- A problem can arise if you produce drawings on one machine, and then run
- programs which incorporate these drawings on another machine with a different
- screen resolution. The Fill option will fill an area neatly (without 'leaking
- out') only if the area is completely enclosed. This is not a problem with
- complete circles and rectangles because they are unbroken.
-
- However, suppose you use the 'line-draw' option to enclose an area prior to
- filling and that you take care to close up the area properly. This area may
- then fill properly in, say, EGA. However when you run this same code on a
- machine with VGA, the higher resolution of the VGA screen may mean that a tiny
- gap exists between the beginning of the line and the end. You may find that
- the colour leaks out when the fill operation takes place.
-
- There are two obvious solutions to this problem. The first is to do your
- drawing on a high resolution screen; I do all of mine on a VGA screen. The
- other is to make sure that you overlap the ends of lines very slightly if you
- are going to use the fill option with that line.
-
- Above all, practice with AutoGraphic. I hope that you find it as much fun to
- use as I have done.
-
- Using AutoGraphic with a Laser Disc Player.
-
- If you are lucky enough to have a laser disc player which is controlled via a
- MIC card, then you can draw pictures directly on top of a video image. In
- fact, this was one of the main reasons that AutoGraphic was developed and this
- explains why I was so obsessed with making sure that we could draw anywhere on
- the screen. No matter where I put the menu, someone found a video image where
- the menu sat on top of an important part of the image.
-
- It is perfectly possible to set up the laser player 'manually' using the MIC
- commands. However, to make life easy there are two tiny programs LASERON and
- LASEROFF which make the job easier. Suppose that you wish to draw on top of
- the 23432 frame on a laser disc. Turn on the laser player and put in the laser
- disc. Make sure that you are in the correct subdirectory to use AutoGraphic
- (see above) and type LASERON and press the Enter key. You will be asked which
- frame number you want to use, type in 23432 and press the Enter key. LASERON
- will wake up the laser player, find that frame and display it on the screen as
- a still. Then you can run AutoGraphic and draw on top of the still. Once you
- have finished, you must run the program called LASEROFF which shuts down the
- connection to the laser player.
-
- Further details are available from :-
-
- Mark Whitehorn.
- Easterton,
- By Monikie,
- Broughty Ferry,
- Dundee. DD1 4HN.
- Scotland.
-
- Turbo Pascal and all Borland products are trade marks or registered trade
- marks of Borland International inc. 1983-1989 or Borland\Analytica.
-
-