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 / gprocs / overlay.icn < prev    next >
Text File  |  2000-07-29  |  1KB  |  49 lines

  1. ############################################################################
  2. #
  3. #    File:     overlay.icn
  4. #
  5. #    Subject:  Procedure to overlay an image in a window
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     May 26, 1994
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  overlay(window, image) writes the image in the window, a line at a time.
  18. #
  19. ############################################################################
  20. #
  21. #  Requires:  Version 9 graphics
  22. #
  23. ############################################################################
  24. #
  25. #  Links:  xcompat
  26. #
  27. ############################################################################
  28.  
  29. link xcompat
  30.  
  31. procedure overlay(window, name)
  32.    local pixmap, width, height, x
  33.  
  34.    pixmap := XBind(, , "image=" || name) |
  35.       stop("*** cannot bind image")
  36.  
  37.    width := WAttrib(pixmap, "width")
  38.    height := WAttrib(pixmap, "height")
  39.  
  40.    every x := 0 to width - 1 do
  41.       CopyArea(pixmap, window, x, 0, 1, height, x, 0)
  42.  
  43.    close(pixmap)
  44.  
  45.    return
  46.  
  47. end
  48.  
  49.