home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / gpiimage.zip / README < prev    next >
Text File  |  1998-04-20  |  6KB  |  132 lines

  1. IMAGE PORTING APPLICATION
  2. =========================
  3.  
  4. The purpose of the IMAGE sample is twofold :-
  5.  
  6.   i) to demonstrate how to port an existing 16-bit application, which
  7.      can be run on the toolkit supplied with OS/2 1.3, to 32-bit.
  8.  
  9.   ii) to demonstrate the Image functionality of the GPI, and the standard
  10.       File Open dialog.
  11.  
  12. Looking at each of the above statements in more detail...
  13.  
  14. GPI Image Functions/File Open Dialog
  15. ------------------------------------
  16.   This program displays an image using the GpiImage() call. The image
  17. data comes from a file which the user must select using the standard
  18. File Open dialog which is invoked by selecting 'Open...' on the
  19. File submenu.
  20.   If the selected image is larger than the maximum picture area, any
  21. part of the image lying off the screen can be scrolled by using the
  22. horizontal and vertical scroll bars.  Alternatively, the entire
  23. image can be displayed by stretching or compressing it to fit the
  24. target rectangle. This is the way the image is displayed initially.
  25.  
  26.   An image-data file comprises a file header (which contains the
  27. image width and height in pels) and the pel data itself (which
  28. describes the on and off settings of the pels in the image).
  29.  
  30.   An image-data file has the following format:
  31.  
  32.                     IMAGE WIDTH (in BYTES)
  33.  BYTE    0          1          2          3         4
  34.    -------------------------------------------------------
  35.    | <space>   |  <space> | <space>  | <space>  | Comma  |
  36.    | or ASCII  | or ASCII | or ASCII | or ASCII |   ,    |
  37.    |  digit    |  digit   |  digit   |  digit   |        |
  38.    |(Thousands)|(Hundreds)| (Tens)   |  (Ones)  |        |
  39.    -------------------------------------------------------
  40.  
  41.  
  42.            IMAGE HEIGHT (in PELS)
  43.  BYTE    5          6          7          8
  44.    ----------------------------------------------
  45.    | <space>   | <space>  | <space>  | <space>  |
  46.    | or ASCII  | or ASCII | or ASCII | or ASCII |
  47.    |  digit    |  digit   |  digit   |  digit   |
  48.    |(Thousands)|(Hundreds)|  (Tens)  |  (Ones)  |
  49.    ----------------------------------------------
  50.  
  51.  
  52.                       IMAGE DATA
  53.  BYTE    10         11                      End of File
  54.     --------------------------------------------------
  55.     |          |          |                          |
  56.     |  Binary  |  Binary  |       . . . . . .        |
  57.     |  data    |  data    |                          |
  58.     |          |          |                          |
  59.     --------------------------------------------------
  60.  
  61.  
  62. Porting to 32-Bit
  63. -----------------
  64.   It details the intermediate stages to achieve the port.  As a result there
  65. are more than one .MAK/.DEF file in order to illustrate building different
  66. versions of the IMAGE application.
  67. You will find these groups of .MAK/.DEF files:
  68.  
  69.   a) IMAGE16.MAK/.DEF - pure 16-bit application that can be compiled using
  70.                         the OS/2 1.3 tools/headers/libraries.
  71.  
  72.   b) IMAGES1.MAK/.DEF - Port to 32-bit : Stage 1 - This involves recompiling
  73.                         the original source using the OS/2 2.0 headers and
  74.                         the 32-bit tools/libraries for 32-bit source
  75.                         files, and 16-bit tools/libraries for the 16-bit
  76.                         source file.  Note: the 16-bit utility routines are
  77.                         primarily for demonstration purposes only, and should
  78.                         not be considered for real applications in their
  79.                         current form.
  80.  
  81.   c) IMAGE32.MAK/.DEF - pure 32-bit application that can be compiled using
  82.                         the OS/2 2.0 tools/headers/libraries.
  83.  
  84. The IMAGE32.MAK/.DEF files will produce a 32-bit executable file of the same
  85. name, IMAGE32.EXE.  The IMAGE16.MAK/IMAGES1.MAK and .DEF files are provided
  86. for comparison purposes.  Together with the source files, they are not
  87. sufficient to build a 16-bit executable.  They have a dependency on an OS/2 1.3
  88. toolkit being available locally, since they need 16-bit compilers/linkers.  The
  89. sample source files contain conditional compilation statements for PORT_16,
  90. which show some of the changes needed in making the port.
  91.  
  92.  
  93. ORGANIZATION OF SOURCE FILES
  94. ============================
  95.  
  96. Here is list of the source files included in the image application
  97. and their general purpose.
  98.  
  99.     img_main.h - application constants
  100.     img_xtrn.h - external variable and function declarations
  101.     img_help.h - help panel ids
  102.     img_dlg.h  - dialog box constants and item ids.  This file is designed
  103.                  to be used with the Dialog Editor.
  104.  
  105.     img_main.c - main function, main window procedure
  106.                  and Exit List processing routines
  107.     img_init.c - initialization
  108.     img_file.c - routines for processing File menu items
  109.     img_view.c - routines for processing View menu items
  110.     img_util.c - utility routines (ie memory allocation/de-allocation)
  111.     img_size.c - routines for sizing/scrolling
  112.     img_dlg.c  - application specific dialog boxes
  113.     img_help.c - help manager functions
  114.     img_pnt.c  - routines for painting the main window
  115.     img_menu.c - routines for menu handling
  116.     img_data.c - global data declarations
  117.  
  118.     img_main.rc - main resource file containing menus, stringtable, etc.
  119.     img_help.rc - resource file for help panels
  120.  
  121.     img_main.ipf - main help text file, contains the link to the others
  122.     img_file.ipf - help text file for the File menu items
  123.     img_view.ipf - help text file for the View menu items
  124.     img_help.ipf - help text file for the Help menu
  125.  
  126.     image16.mak  - 16-bit Image sample NMAKE file
  127.     image16.def  - 16-bit module definition file
  128.     imageS1.mak  - Porting stage 1 NMAKE file
  129.     imageS1.def  - Porting stage 1 module definition file
  130.     image32.mak  - 32-bit Image sample NMAKE file
  131.     image32.def  - 32-bit module definition file
  132.