home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / gprogs / giftopat.icn < prev    next >
Text File  |  2000-07-29  |  1KB  |  47 lines

  1. ############################################################################
  2. #
  3. #    File:     giftopat.icn
  4. #
  5. #    Subject:  Program to convert GIF image to hex-form pattern
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     May 29, 1999
  10. #
  11. ############################################################################
  12. #
  13. #  This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program convert GIF images, whose names are given on the command
  18. #  line to bi-level patterns.  The GIFs are expected to be black and white.
  19. #  All non-white pixels are treated as black
  20. #
  21. ############################################################################
  22. #
  23. #  Requires:  Version 9 graphics
  24. #
  25. ############################################################################
  26. #
  27. #  Links:  imsutils, wopen
  28. #
  29. ############################################################################
  30.  
  31. link imsutils
  32. link wopen
  33.  
  34. procedure main(args)
  35.    local file, win
  36.  
  37.    while file := get(args) do {
  38.       win := WOpen("image=" || file, "canvas=hidden") | {
  39.          write(&errout, "cannot open ", file)
  40.          next
  41.          }
  42.       write(pix2pat(win, 0, 0, WAttrib("width"), WAttrib("height")))
  43.       WClose(win)
  44.       }
  45.  
  46. end
  47.