home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 336_01 / egapal.doc < prev    next >
Text File  |  1990-04-20  |  11KB  |  322 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                     EGAPAL
  19.                                  Version 1.0
  20.                               (c) Copyright 1990
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.         EGAPAL is a series of programs which allow the user to create
  29. graphic images for the 640x350, 16 color mode.  Once completed, these
  30. images are saved to either an image file or encoded into a header file.
  31. Finally, a series of subroutines contained in a library file allow these
  32. images to be displayed in user written, Turbo C programs.
  33.  
  34.         EGAPAL was written out of a need of finding an inexpensive way
  35. to produce graphic images to be included computer games I plan to write
  36. in the future.  I also wanted a product that would allow me to load
  37. these images in memory, to be recalled and displayed quickly with a
  38. limited amount of coding.  Since I didn't have the $99 plus dollars to
  39. invest in a program that may not even fit my needs, I decided to write
  40. EGAPAL.  Hopefully these programs will fit the bill for other budding
  41. programmers as well.
  42.  
  43.         EGAPAL is a shareware product.  That means you have the
  44. opportunity to test the software and determine whether the product fits
  45. your needs.  If you continue to use EGAPAL after this point you are
  46. obligated to register your copy by sending $20 to:
  47.  
  48.                         Scott Young
  49.                         P.O. Box 1550
  50.                         Section #8
  51.                         Portsmouth, NH  03802
  52.  
  53. Not only does this money reward my efforts, it also gives you the
  54. opportunity to receive a free upgrade when the next version is released.
  55. Another advantage of registering is that I am actively soliciting
  56. comments and suggestions from users and plan to implement many of them
  57. in the next version.  Currently I have a need to add the following two
  58. items:  1) full graphic screen editing  2) a TIF file import facility.
  59. The current version of EGAPAL allows you to edit images with the maximum
  60. size being 121x76 pixels.  If you wanted to make a graphic screen at
  61. this point you would need to divide the screen into several sections,
  62. create the images, and then put them together in "patchwork" fashion.
  63. I would like to see a TIF import facility because I am no freehand
  64. graphics artist (I have trouble making stick men!).  This will allow me
  65. to import a perfectly proportional black and white images to be modified
  66. and given color.  I am sure you users out there can think of other ways
  67. to improve the product as well.  Registering your copy and sharing
  68. suggestions helps us all!
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.                                    1
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88. FILES
  89. =====
  90.  
  91. The EGAPAL product consists of the following files:
  92.  
  93. EGAPAL.EXE    -  The graphic image editor program.
  94.  
  95. EGAPAL-H.EXE  -  A program which reads EGAPAL graphic image files (.PLI)
  96.                  and creates header files to be included in Turbo C
  97.                  programs.
  98. EGAPAL.LIB    -  The EGAPAL library of subroutines which copy graphics
  99.                  images from disk or header files to the screen.
  100. EGAPAL.DOC    -  This file.
  101.  
  102. LOGO.PLI      -  An image file containing the EGAPAL logo.
  103.  
  104. LOGO.H        -  A header file containing the EGAPAL logo.
  105.  
  106. PALETTE.PLI   -  An image file containing the picure of a palette.
  107.  
  108. PALETTE.H     -  A header file containing the picure of a palette.
  109.  
  110. TEST.C        -  A sample program that demonstrates how graphic images
  111.                  are displayed on the screen.
  112. TEST.PRJ      -  Turbo C project file for TEST.C
  113.  
  114. EGAVGA.BGI    -  Turbo C's EGA/VGA graphics driver.
  115.  
  116.  
  117.  
  118. USING EGAPAL
  119. ============
  120.  
  121.         To create graphic images run the program EGAPAL.EXE.  After
  122. reading the copyright box, hit any key to display the entire image
  123. editor screen.  In the upper left hand corner of the screen is the
  124. 25x40 box where your images will be created.  This box is discussed
  125. in detail in the draw command section.  Below the large box are 16
  126. small rectangles containing the 16 default colors you will use to make
  127. your images.  The colors found in the interior 14 rectangles can be
  128. changed to any of the 64 colors available in the EGAHI and VGAMED
  129. graphics modes.  Below the colored rectangles are 4 larger rectangles
  130. labeled F1 thru F4.  Hitting the appropriate function key executes the
  131. command contained in the corresponding rectangle.  The "Actual Size"
  132. box is found in the center of the screen to the right.  As you create
  133. you image in the large box, you actual image will appear in this box.
  134. Above this box is the "Current Color" box.  This box will contain the
  135. color you are currently using.
  136.  
  137.  
  138.  
  139.                                    2
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. SELECTING COLORS FOR YOUR IMAGE
  148. ===============================
  149.  
  150.         Sixteen default colors are provided for you when you begin
  151. using EGAPAL.  To change these colors hit F1 from the main menu
  152. (Selete Palette).  A set of new commands will now appear.  Next you
  153. need to decide which of the default colors you want to change.  Hit
  154. F1 (Arrow Left) or F2 (Arrow Right) to move the selection arrow under
  155. your choice (Note:  Black and white cannot be changed).  Then hit F3
  156. (Change Color) repeatedly to see all 64 colors available to you.  Once
  157. you find a color you like you can continue to change other default
  158. colors or hit F4 (Quit) to return to the main menu.  When an image is
  159. saved to disk, your color selections are saved as well (see Loading and
  160. Saving Images).
  161.  
  162.  
  163.  
  164. CREATING AN IMAGE
  165. =================
  166.  
  167.         To begin creating an image hit F3 (Draw) from the main menu.
  168. Next, select your first drawing color by hitting F1 (Select Color).
  169. Move the selection arrow to the desired color by using the F1 (Arrow
  170. Left) and F2 (Arrow Right) keys.  Hit F3 (Select Color) to lock in your
  171. choice.  After F3 is hit, the "Current Color" box displays your selected
  172. color.  Use this routine whenever you want to change the drawing color.
  173.  
  174.         Hit the F2 (Plot Colors) key to begin drawing.  A square cursor
  175. will appear in the 25x40 box.  Using the four arrow keys, move the
  176. cursor to where you want to begin drawing.  Next hit F1 (Turn Plot On)
  177. to enable the plotting facility.  The arrow keys are then used to draw
  178. your image in the current drawing color.  As you plot colors in the
  179. 25x40 box, the image begins to appear in the "Actual Image" box.
  180.  
  181.         There will be times when you want to suspend plotting and move
  182. the cursor to another location within your image.  Hit F1 (Turn Plot
  183. Off) and move the cursor to the new location.  Resume plotting by
  184. hitting F1 (Turn Plot On) again.  (Notice the F1 key toggles on and off)
  185.  
  186.         As you create your image mistakes will invariably be made.  To
  187. erase a mistake move the cursor to the mistake and hit F1 (Turn Plot
  188. Off).  Then by hitting F2 (Erase Boxes) and moving your cursor over the
  189. the mistake, the pixels will revert back to the background color of
  190. black.  Hit F4 (Quit Erasing) when done.
  191.  
  192.         When you are done plotting the upper left-hand corner of your
  193. image you will want to change the original 0-25 vertical and 0-40
  194. horizontal view.  Hit F4 (Quit) to end plotting followed by F3 (Move
  195. Window).  The entire 75x120 image area will be shown with a smaller
  196.  
  197.  
  198.  
  199.                                    3
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207. box in the upper left-hand corner.  The smaller box represents the
  208. area you have just been plotting.  Using the arrow keys, move the
  209. smaller box to the next plotting area.  Hit enter when done.
  210.  
  211.  
  212.  
  213. LOADING AND SAVING IMAGES
  214. =========================
  215.  
  216.         Unless you like to live dangerously, you will want to save your
  217. images often as you are creating them.  Also there will be times when
  218. you want to modify and/or complete images as well.  Hit F2 (File) from
  219. the main menu to enter the file loading and saving section.
  220.  
  221.         EGAPAL creates two different types of files, work files and
  222. image files.  Work files are created when you hit the F2 (Save Work)
  223. key and enter a filename.  Work files have an extension of .PLW and
  224. contain the image's 16 palette colors and plotted points.  Image files
  225. are created when you hit F3 (Save Image) and enter a filename.  Image
  226. files have an extension of .PLI and are loaded into you "C" programs
  227. by way of a function in the library file EGAPAL.LIB.  (Note:  The F3
  228. option will not appear when there is no image in the editor)  The F1
  229. (Load Work) key will allow you to load a previously saved work file.
  230. A complete listing of all the work files will appear on the screen in
  231. alphabetical order.  Highlight your choice and enter.  If you have
  232. lots of work files you may need to toggle to a second or third page.
  233. Once your choice is made the image is loaded into the plotting box.
  234. From that point you are ready to continue your work.
  235.  
  236.         When you are ready to exit the program hit F4 (Quit) from the
  237. main menu.  F1 (Quit Please!) takes you back to the DOS prompt.  F2
  238. (Don't Quit!) gives you the opportunity to get back to the main menu.
  239.  
  240.  
  241.  
  242. THE EGAPAL-H.EXE PROGRAM
  243. ========================
  244.  
  245.         The EGAPAL-H.EXE program is a utility that lets you read an
  246. image file (.PLI) and create a header file (filename.H) to be included
  247. in your Turbo C programs.  The header file consists of two arrays.  The
  248. first array contains the values representing the image's 16 palette
  249. colors.  The second array contains the image itself.  Two functions in
  250. the EGAPAL.LIB use these arrays to display images.
  251.  
  252.         When you run EGAPAL-H.EXE an alphabetical list of all the image
  253. files (.PLI) appears.  Highlight the desired file and enter.  If you
  254. have lots of image files in the current directory you may need to toggle
  255. to another page to find your choice.  A header file with the image's
  256. filename and an extension of .H is then created.
  257.  
  258.  
  259.  
  260.                                    4
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. THE EGAPAL.LIB LIBRARY FILE
  269. ===========================
  270.  
  271.         The EGAPAL.LIB library file contains three function that load
  272. images to your screen.  The first function reads an image file (.PLI),
  273. loads the image's 16 colors, and displays the image:
  274.  
  275.  
  276.                    file_image(x,y,"filename.ext")
  277.  
  278.         example:   file_image(200,100,"logo.pli");
  279.  
  280.  
  281. The variables x and y are integers representing the location on the
  282. 640x350 screen you want the image to be placed.  The image's filename
  283. is entered in the funtion's third position.
  284.  
  285.         When the image information is loaded from a header file, two
  286. functions are used to display an image.  The first function loads the
  287. image's 16 colors into memory. (Note:  Previous color selections will be
  288. erased!)
  289.  
  290.  
  291.                    coded_palette(array)
  292.  
  293.         example:   coded_palette(LOGO);
  294.  
  295.  
  296. The second function loads the image:
  297.  
  298.  
  299.                    coded_image(x,y,array)
  300.  
  301.         example:   coded_image(200,100,array);
  302.  
  303.  
  304. The variables x and y are integers representing the location on the
  305. 640x350 screen you want the image to be placed.  The image's array name
  306. is entered in the function's third position.
  307.  
  308.  
  309.  
  310. EGAPAL TEST PROGRAM
  311. ===================
  312.  
  313.         I have found that I learn new concepts in programming best
  314. when I have a working examples to pick apart and test.  Taking a look
  315. at TEST.C and TEST.PRJ should be helpful.  You can compile TEST.C with
  316. the project file TEST.PRJ to make a working executable file.
  317.  
  318.  
  319.  
  320.                                    5
  321.  
  322.