home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / TOOLKIT / PM / BMPSAMP / README < prev    next >
Text File  |  1995-06-08  |  4KB  |  111 lines

  1.  
  2.  
  3. BMPSAMP - Bitmap Manipulation
  4.  
  5.  
  6. DESCRIPTION:
  7.  
  8. This sample provides a jigsaw puzzle, based on a decomposition of an
  9. arbitrary bitmap loaded from a file.  The user can jumble the pieces,
  10. then drag them individually by means of the mouse.  The image can be
  11. made larger or smaller, scrolled up/down or left/right.
  12.  
  13.  JIGSAW uses GpiBitBlt with clip paths to create a collection of picture
  14.  fragments which are the puzzle pieces.  In earlier versions of the
  15.  program, each of these pieces was associated with a single retain-mode
  16.  graphics segment.  The retain-mode technique, however, proved to be
  17.  too slow, so subsequent versions of the program used retain-mode APIs
  18.  for fewer and fewer operations.  The current version eliminates
  19.  retain-mode graphics altogether.  Instead, the drawing data for each
  20.  piece is stored in _SEGLIST data structure defined in JIGSAW.H.
  21.  This structure contains all the data needed to draw a piece, including
  22.  pointers to the previous and next pieces.  The _SEGLIST nodes are
  23.  arranged in drawing priority order, so the picture can be reconstructed
  24.  by traversing the list in sequence, drawing each piece as its
  25.  corresponding structure is encountered.  Where the comments in the
  26.  rest of the program refer to a "segment," they are simply referring to
  27.  a piece of the puzzle as defined by a record in this data structure.
  28.  
  29.  To retain responsiveness to user requests, the real work is done in a
  30.  second thread, with work requests transmitted from the main thread in
  31.  the form of messages.  This arrangement makes it possible for the user
  32.  to override lengthy drawing operations with a higher-priority request
  33.  (eg. program termination, magnification change, etc.).
  34.  
  35.  Individual pieces are made to "move" by changing their model transforms.
  36.  Scrolling and zooming of the whole picture is done by changing the
  37.  default viewing transform.  The points in model space associated with
  38.  each piece (control points for the bounding curve, corners of the
  39.  bounding box, etc.) are converted via GpiConvert into points in device
  40.  space prior to use with GpiBitBlt, etc.
  41.  
  42. TASK:
  43.  
  44.  Use of bitmaps in a jigsaw puzzle.
  45.  
  46. CONCEPT/FEATURE:
  47.  
  48.  Sample illustrates the use of the Graphical Programming Interface in 
  49.  a graphics application.
  50.  
  51. SAMPLE LOCATION:
  52.  
  53.  Inside the PM Sample Programs folder (which is inside the VisualAge C++ 
  54.  Samples folder).
  55.  
  56. Note: This sample is not provided in project form.
  57.  
  58. SOURCE FILE LOCATION:
  59.  
  60.  X:\ibmcpp\samples\toolkit\pm\bmpsamp
  61.  where X: is the drive you installed the samples and document component
  62.  of VisualAge C++ for OS/2.
  63.  
  64.  
  65. HOW TO RUN THE SAMPLE:
  66.  
  67. -From your OS/2 desktop:
  68.  Double-click on the sample's icon.
  69.  
  70. -From an OS/2 command prompt:
  71.  To start a non-WorkPlace Shell sample program from an OS/2 command
  72.  prompt, type the name of the executable file and press Enter.  If you
  73.  have edited source code of a sample program and want to recompile,link,
  74.  and run the files, use the NMAKE tool. Your output is the executable
  75.  file.  For information about the NMAKE utility, see the
  76.  OS/2 Tools Reference.
  77.  
  78.  
  79. SOFTWARE/HARDWARE PREREQUISITES:
  80.  
  81.  
  82. - IBM VisualAge C++
  83. - OS/2 Warp
  84. - IBM or compatible 386 and up.
  85.  
  86.  
  87. REQUIRED FILES      DESCRIPTIONS
  88.  
  89.   cheap.dlg         Dialog resource
  90.   globals.c         Global definitions
  91.   globals.h         Global declarations
  92.   jighelp.c         Help Manager Interface routines
  93.   jighelp.h
  94.   jighelp.rc        resource file
  95.   jigsaw.c          Main() entry point
  96.   jigsaw.def        link definitions
  97.   jigsaw.dlg        dialog resources
  98.   jigsaw.exe        sample executable
  99.   jigsaw.h
  100.   jigsaw.hlp
  101.   jigsaw.ico
  102.   jigsaw.ipf
  103.   jigsaw.mak        MakeMake generated makefile
  104.   jigsaw.rc
  105.   misc.c            Miscellaneous support functions
  106.   procs.c           Support functions for window procedures
  107.   readme            This file
  108.   statwnd.dlg
  109.   yosemite.bmp
  110.  
  111.