home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / PMCARD.ZIP / METARECT.C < prev    next >
Text File  |  1990-07-11  |  897b  |  29 lines

  1. /*----------------------------------------------------------
  2.    METARECT.C -- A function to obtain a metafile image size
  3.                  (c) Ziff Communications Co, 1990
  4.                  PC Magazine * Charles Petzold, 7/90
  5.   ----------------------------------------------------------*/
  6.  
  7. VOID QueryMetaFileBoundaryRect (HAB hab, HMF hmf, RECTL *prcl)
  8.      {
  9.      HPS   hps ;
  10.      SIZEL sizlPage ;
  11.  
  12.      sizlPage.cx = 100 ;
  13.      sizlPage.cy = 100 ;
  14.  
  15.      hps = GpiCreatePS (hab, NULL, &sizlPage, PU_ARBITRARY) ;
  16.  
  17.      GpiSetDrawControl (hps, DCTL_DISPLAY, DCTL_OFF) ;
  18.      GpiSetDrawControl (hps, DCTL_BOUNDARY, DCTL_ON) ;
  19.  
  20.      GpiPlayMetaFile (hps, hmf, 0L, NULL, NULL, 0L, NULL) ;
  21.  
  22.      GpiSetDrawControl (hps, DCTL_DISPLAY, DCTL_ON) ;
  23.      GpiSetDrawControl (hps, DCTL_BOUNDARY, DCTL_OFF) ;
  24.  
  25.      GpiQueryBoundaryData (hps, prcl) ;
  26.  
  27.      GpiDestroyPS (hps) ;
  28.      }
  29.