home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / bitmapsr / read.me < prev   
Encoding:
Text File  |  1993-10-30  |  4.1 KB  |  83 lines

  1.  
  2.  
  3.                        BITMAP32       ---    30 December 1992
  4.  
  5.  
  6. BITMAP32.EXE is a small application that allows one to view bitmap image 
  7. files in various formats.  To do this is uses the GBM code from Andy Key in 
  8. Hursley. The source code is provided.
  9.  
  10. The bitmap displayer, and the associated code demonstrate two methods of
  11. bitmap drawing.  One method rescales the image as it is being drawn to the
  12. screen.  This method doesn't look so great while drawing (it draws in bands),
  13. plus if part of the window needs to be painted (e.g. another app. was
  14. partially covering it), the whole window gets repainted, again with the
  15. bands.  The other method is to keep one copy of the original bitmap in
  16. memory, and then when it is time to draw it, to make another copy, *scaling
  17. it in memory*, and then "blasting" the scaled copy to the screen.  This
  18. process is repeated for subsequent repaints ONLY if the size of the window
  19. has changed.  If it hasn't changed size, then we just "reblast" our scaled
  20. bitmap.  This method is *extermely* quick when the window needs to be
  21. repainted and the size hasn't changed (that's how PMLOGO does it so quick),
  22. but this mehtod is also very expensive, because two bitmaps must be kept in
  23. memory at all times.
  24.  
  25. It is not possible to throw away the original bitmap once we have a scaled
  26. bitmap in memory because the GpiBitBlt function made some approximations when
  27. scaling the bitmap, so if our new bitmap in memory was very thin and long,
  28. and we threw out the original, then the long thin bitmap would become our
  29. reference for subsequent sizing requests, and we would be all screwed up.
  30.  
  31. If the window you are drawing to cannot be sized, then you can throw away the
  32. original once you have created the "in-memory" reference, but you still need
  33. the both in memory at once while creating the "in-memory" reference!!  Still,
  34. if fast repainting is a must (like it is for PMLOGO), then this is probably
  35. the best method for you.
  36.  
  37. You can see the difference between the two modes by selecting "Drawing" from
  38. BITMAP.EXE's action bar and changing the "Keep scaled bitmap in memory" 
  39. state.
  40.  
  41. Other options on the menus include:
  42.    Use palette management - uses Palette Manager functions to display the 
  43.                             bitmap in the original colors, instead of
  44.                             translating to the default system palette.
  45.    Maintain bitmap proportions - keeps the relative x and y sizes in 
  46.                             proportion to that in the original bitmap.
  47.  
  48. The command line invocation of BITMAP32 is:
  49.  
  50.    BITMAP32 [switches] filename
  51.  
  52. where the optional switches are:
  53.         /e      - ignore errors. Don't pop up a message box on an error.
  54.         /h      - vertical size of display window
  55.         /i      - minimize on startup
  56.         /k      - don't keep scaled bitmap in memory
  57.         /oopts  - pass "opts" to GBM as options when loading bitmaps
  58.         /p      - display bitmaps with palette manager support
  59.         /r      - display bitmaps keeping the x and y proportions correct
  60.         /s      - filename is a slide show file, otherwise it is a bitmap
  61.         /w      - horizontal size of display window
  62.         /x      - horizontal position of display window
  63.         /y      - vertical position of display window
  64.         /z      - maximize on startup
  65.  
  66. Switches e, k, p and r are flip-flop switches, inverting the default (last)
  67. state of the switch.
  68.  
  69. A slide show file consists of lines describing a slide show. The following 
  70. are valid slide show file lines:
  71.  
  72. /               - terminate the slide show.
  73. /i              - set the default to wait for user input before advancing to 
  74.                   a new slide.
  75. /nnn            - wait "nnn" seconds before advancing to the next slide.
  76. path            - full or relative path to a bitmap file to be displayed as 
  77.                   the next slide.
  78. path /i         - show this bitmap file and wait for user action before 
  79.                   advancing.
  80. path /nnn       - show this bitmap file and wait "nnn" seconds before 
  81.                   advancing to the next slide.
  82.  
  83.