home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxgd101.zip / GI.CMD < prev    next >
OS/2 REXX Batch file  |  1997-02-23  |  1KB  |  54 lines

  1. /* ---------------------------- */
  2. /* Image File support code test */
  3. /*                              */
  4. /* GIF Info GI.CMD              */
  5. /*                              */
  6. /* Display some info  for the   */
  7. /* GIF file                     */
  8. /*                              */
  9. /* ---------------------------- */
  10. Call RxFuncAdd 'RxgdLoadFuncs', 'RXGDUTIL', 'RxgdLoadFuncs'
  11. Call RxgdLoadFuncs
  12.  
  13. parse ARG cl
  14.  
  15.   im = RxgdImageCreateFromGIF(cl)
  16.  
  17.   IF (im == 1) THEN
  18.     DO
  19.  
  20.     clGIF = cl || '.GIF'
  21.  
  22.     im = RxgdImageCreateFromGIF(clGIF)
  23.  
  24.     IF (im == 1) THEN
  25.       DO
  26.       Say 'File --->' || cl || '<--- not found.'
  27.       RETURN
  28.       END
  29.  
  30.     cl = cl || '.GIF'
  31.  
  32.     END
  33.  
  34.   Say 'GIF Information for ' cl
  35.   Say ' '
  36.   Say 'Image Handle     = ' im
  37.   Say 'Total Colors     = ' RxgdImageColorsTotal(im)
  38.   i = RxgdImageGetInterlaced(im)
  39.   IF (i == 0) THEN
  40.     InterL = 'No'
  41.   else
  42.     InterL = 'Yes'
  43.   Say 'Interlaced       = ' InterL
  44.   t = RxgdImageGetTransparent(im)
  45.   if (t <> -1 ) THEN
  46.      Say 'Transparent      = ' FORMAT(t, 3) '  Red=' FORMAT(RxgdImageRed(im, t),3) '  Blue=' FORMAT(RxgdImageBlue(im, t),3) '  Green=' FORMAT(RxgdImageGreen(im, t),3)
  47.   Say ' '
  48.   Say 'Width            = ' RxgdImageSX(im)
  49.   Say 'Height           = ' RxgdImageSY(im)
  50.  
  51.   rc = RxgdImageDestroy(im)
  52.  
  53. Call RxgdUnloadFuncs
  54.