summaryrefslogtreecommitdiff
path: root/ipl/gprocs/repeats.icn
blob: 524ea6125456004ae80fd9e14e67f5ef2f275a93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
############################################################################
#
#	File:     repeats.icn
#
#	Subject:  Procedure to repeat image
#
#	Author:   Ralph E. Griswold
#
#	Date:     August 23, 1996
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#  This procedure produces repeats of an image specified number of times.
#
############################################################################
#
#  Requires:  Version 9 graphics
#
############################################################################
#
#  Links:  tile, wopen
#
############################################################################

link tile
link wopen

procedure repeats(name, i, j)		#: repeat image
   local opts, prefix, win1, win2, width, height
   local auto, wdim, hdim, limit

   /i := 1			# horizontal repeats
   /j := 1			# vertical repeats

   win1 := WOpen("canvas=hidden", "image=" || name) | fail
   width := WAttrib(win1, "width")
   height := WAttrib(win1, "height")
   hdim := height * i
   wdim := width * j

   win2 := WOpen("canvas=hidden", "width=" || wdim, "height=" || hdim) |
      stop(&errout, "*** cannot open window for repeat")

   tile(win1, win2)

   WClose(win1)

   return win2
end