diff options
Diffstat (limited to 'ipl/gprogs/zoomtile.icn')
-rw-r--r-- | ipl/gprogs/zoomtile.icn | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/ipl/gprogs/zoomtile.icn b/ipl/gprogs/zoomtile.icn new file mode 100644 index 0000000..1489660 --- /dev/null +++ b/ipl/gprogs/zoomtile.icn @@ -0,0 +1,70 @@ +############################################################################ +# +# File: zoomtile.icn +# +# Subject: Program to show a tile magnified +# +# Author: Ralph E. Griswold +# +# Date: June 28, 2002 +# +############################################################################ +# +# This file is in the public domain. +# +############################################################################ +# +# This program provides an optionally magnified view of a tile. +# +# File names are given on command line. Image files are written to +# <basename>_zoom.gif. +# +# Options are: +# +# -z i zoom factor, default 8 +# -g provide grid; only supported if zoom factor > 2 +# +############################################################################ +# +# Requires: Version 9 graphics +# +############################################################################ +# +# Links: basename, options, patutils, win +# +############################################################################ + +link basename +link options +link patutils +link win + +procedure main(args) + local i, x, y, opts, magnif, pattern, dims, row, pixel, width, height, glist + local name, input + + opts := options(args, "z+g") + magnif := \opts["z"] | 8 + + every name := !args do { + input := open(name) | stop("Cannot open ", name) + pattern := readpatt(input) | stop("*** no tile specification") + close(input) + dims := tiledim(pattern) + width := magnif * dims.w + height := magnif * dims.h + win(width, height) + glist := [] + if \opts["g"] & (magnif > 2) then { + every y := 0 to height by magnif do + DrawLine(0, y, width, y) + every x := 0 to width by magnif do + DrawLine(x, 0, x, height) + } + DrawTile(0, 0, pattern, , magnif) + WriteImage(basename(name, ".blp") || "_zoom.gif") + WClose(&window) + &window := &null + } + +end |