home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / DVIM72-Mac 1.9.6 / source / Copy_banded.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-14  |  1.3 KB  |  45 lines  |  [TEXT/R*ch]

  1. #include "Copy_banded.h"
  2. #include "mac-specific.h"
  3.  
  4. /*
  5.     Printing on the ImageWriter with a high font resolution and offscreen
  6.     drawing caused blank pages to be output.  Apparently that driver
  7.     cannot handle large bitmaps.  Hence this routine.
  8. */
  9.  
  10. Boolean        g_print_by_bands;
  11.  
  12. void Copy_banded( BitMap *source_map, BitMap *dest_map,
  13.     Rect *source_rect, Rect *dest_rect )
  14. {
  15.     Rect    source_strip, dest_strip;
  16.     short    source_strip_depth, dest_strip_depth;
  17.     
  18.     if (g_print_by_bands)
  19.     {
  20.         dest_strip_depth = (**g_print_rec_h).prXInfo.iBandV;
  21.         if (dest_strip_depth <= 0)
  22.             dest_strip_depth = 32;
  23.         dest_strip = *dest_rect;
  24.         dest_strip.bottom = dest_strip.top + dest_strip_depth;
  25.         source_strip = dest_strip;
  26.         MapRect( &source_strip, dest_rect, source_rect );
  27.         source_strip_depth = source_strip.bottom - source_strip.top;
  28.         while (dest_strip.top < dest_rect->bottom)
  29.         {
  30.             if (dest_strip.bottom > dest_rect->bottom)
  31.             {
  32.                 dest_strip.bottom = dest_rect->bottom;
  33.                 source_strip = dest_strip;
  34.                 MapRect( &source_strip, dest_rect, source_rect );
  35.             }
  36.             CopyBits( source_map, dest_map,
  37.                 &source_strip, &dest_strip, srcCopy, nil );
  38.             OffsetRect( &source_strip, 0, source_strip_depth );
  39.             OffsetRect( &dest_strip, 0, dest_strip_depth );
  40.         }
  41.     }
  42.     else
  43.         CopyBits( source_map, dest_map,
  44.             source_rect, dest_rect, srcCopy, nil );
  45. }