home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / pascal / spx10.zip / SPX_DOC.ZIP / SPX_IMG.DOC < prev    next >
Text File  |  1993-05-10  |  4KB  |  104 lines

  1. { SPX Library Version 1.0  Copyright 1993 Scott D. Ramsay }
  2.  
  3.   SPX_IMG is the image handling unit.  It allows loading and saving
  4. of picture files.  It supports loading of 320x200x256 PCX files and
  5. my own custom compressed format.  PTR files are a quick and dirty RLE
  6. picture format. It does not save the palette data in the file so use
  7. the loadcolors/savecolors procedures to use it's palette.
  8.  
  9. ───────────────────────────────────────────────────────────────────────────
  10. type
  11.   VidHdrType = record
  12.                  position,count : word;
  13.                end;
  14.  
  15.   Header type for .PTR format
  16.  
  17. ───────────────────────────────────────────────────────────────────────────
  18. var
  19.   rgb256         : RGBlist;     { palette of last loaded PCX file }
  20.  
  21. ───────────────────────────────────────────────────────────────────────────
  22. function loadpcx(pfilename:string):integer;
  23.  
  24.   Loads a 320x200x256 color PCX file to the active page.  The palette of
  25.   the loaded pcx file will be copied to the variable RGB256.
  26.  
  27.   Returns the IORESULT value
  28.  
  29.   PFILENAME:  DOS file name of the pcx file to load
  30.  
  31.   NOTE: This function is very fast.  However as a cost it will only
  32.     load 320x200x256 pcx files.  Use loadspcx to load pcx files that
  33.     are smaller than 320x200.
  34.  
  35. ───────────────────────────────────────────────────────────────────────────
  36. function loadspcx(fname:string;x,y:integer):boolean;
  37.  
  38.   Loads a 256 PCX file to the active page.  The palette of the loaded
  39.   pcx file will be copied to the variable RGB256.
  40.  
  41.   Returns the IORESULT value
  42.  
  43.   FNAME:  DOS file name of the pcx file to load
  44.   X,Y:    Row,Column position to place the top-left of the pcx file
  45.  
  46.   NOTE: This function is slower than the loadpcx function.  It can load
  47.     256 color pcx files of any resolution.  Large pcx files will be clipped.
  48.  
  49. ───────────────────────────────────────────────────────────────────────────
  50. procedure filepcx(var pcxfile:file;size:longint);
  51.  
  52.   Loads a PCX file from an open file to the active page.  The palette
  53.   of the loaded pcx file will be copied to the variable RGB256.
  54.  
  55.   PCXFILE:  File to read the pcx data;
  56.   SIZE:     Size of the PCX data in the file
  57.  
  58. ───────────────────────────────────────────────────────────────────────────
  59. procedure drawpcx(var p;size:word);
  60.  
  61.    Displays a 320x200x256 PCX file currently in memory.
  62.  
  63.    P:     Buffer where the pcx data is located;
  64.    SIZE:  Size of the PCX data in memory
  65.  
  66. ───────────────────────────────────────────────────────────────────────────
  67. procedure drawspcx(var start;size:longint;x,y:integer);
  68.  
  69.    Displays a 256 color PCX file currently in memory.
  70.  
  71.    START: Buffer where the pcx data is located;
  72.    SIZE:  Size of the PCX data in memory
  73.    X,Y:   Row,Column position to place the top-left of the pcx file
  74.  
  75.    This function will load any size pcx file.  Large files will be clipped.
  76. ───────────────────────────────────────────────────────────────────────────
  77. function LoadPTR(fn:string;merge:boolean):integer;
  78.  
  79.    Loads a .PTR file to the active page.
  80.  
  81.    FN:     DOS file name of the ptr file to load;
  82.    MERGE:  Set to TRUE to overlay the PTR file over the
  83.            active page
  84.  
  85.    Returns the IORESULT value
  86.  
  87. ───────────────────────────────────────────────────────────────────────────
  88. procedure DrawPtr(var p;merge:boolean;sz:longint);
  89.  
  90.   Displays a PTR file currently in memory.
  91.  
  92.   P:     Buffer where the ptr data is located;
  93.   MERGE: Set to TRUE to overlay the PTR file over the
  94.          active page
  95.  
  96. ───────────────────────────────────────────────────────────────────────────
  97. function SavePTR(fn:string):integer;
  98.  
  99.   Save the active page as a PTR file.
  100.  
  101.   FN: DOS file name of the ptr file to save
  102.  
  103. ───────────────────────────────────────────────────────────────────────────
  104.