home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / pascal / vicon19.zip / BGIUSER.DOC < prev    next >
Text File  |  1991-05-24  |  3KB  |  91 lines

  1. ***********************************************************
  2. *                                                         *
  3. *  Save icon in Borland Graphical Interface (BGI) format  *
  4. *                                                         *
  5. ***********************************************************
  6.  
  7.  
  8. Hit Alt+F for File in main menu, then hit S for Save
  9. and F for Format.  Choose Borland graphic image in the
  10. button menu.  Any decent file name may be used here.
  11.  
  12.  
  13. The Save Format normally defaults to the type of icon
  14. loaded into VICON.  Icons that are not externally loaded
  15. automatically defaults to VICON's Native File Format.
  16.  
  17.  
  18.  
  19.  
  20.  
  21. ****************************************************************
  22. *                                                              *
  23. * Import and export icons in Borland Graphical Interface (BGI) *
  24. *                using TURBO PASCAL, C and C++                 *
  25. *                                                              *
  26. ****************************************************************
  27.  
  28. Procedure RetrieveImage(FileName : PathStr;    var P : Pointer);
  29.  
  30. { This routine retrieves an image stored in a disk file within
  31.   your own application.  Call PutImage(X, Y, P^, COPYput) later
  32.   to show the image at (X, Y) on screen.
  33.  
  34.   Turbo C and C++ user should have no problem in translating this.}
  35.  
  36. var
  37.   F : File;
  38.   Size : Word;
  39.  
  40. begin
  41.   Assign(F, FileName);
  42.   Reset(F);
  43.   Size := FileSize(F);
  44.   Reset(F, Size);
  45.   GetMem(P, Size);
  46.   BlockRead(F, P^, 1)
  47.   Close(F)
  48. end;  {RetrieveImage}
  49.  
  50.  
  51.  
  52. Procedure SaveImage(FileName: PathStr;    X1, Y1, X2, Y2 : Word);
  53.  
  54. { This routine saves an image in a disk file within your own
  55.   application.  If you later run VICON and see only part of the
  56.   image, select Resize in the main menu to clip the image to the
  57.   size you desire.
  58.  
  59.   If the image is larger than 64 X 64 pixels, VICON will truncate
  60.   it automatically when it is read from the file.  However, this
  61.   file is not altered until you choose to overwrite it later,
  62.   so that you are free to retrieve and edit any BGI-compatible
  63.   images with VICON. }
  64.  
  65. var
  66.   F : File;
  67.   P : Pointer;
  68.   Size : Word;
  69.  
  70. begin
  71.   Size := ImageSize(X1, Y1, X2, Y2);
  72.   GetMem(P, Size);
  73.   GetImage(X1, Y1, X2, Y2, P^);
  74.   Assign(F, FileName);
  75.   Rewrite(F, Size);
  76.   BlockWrite(F, P^, 1);
  77.   Close(F)
  78. end;  {SaveImage}
  79.  
  80.  
  81.  
  82. P.S.  Vicon is capable of extracting icons from those files
  83.       containing multiple BGI images.
  84.  
  85.  
  86.  
  87. +++++++++++++++++++++++++++++++++++++++++++++++++++++
  88. + Please read ReadMe.DOC, Register.DOC, Licence.DOC +
  89. +++++++++++++++++++++++++++++++++++++++++++++++++++++
  90.  
  91.