source: branches/blt4/examples/zoo/image/image.tcl @ 1650

Last change on this file since 1650 was 1650, checked in by gah, 14 years ago
File size: 1.3 KB
Line 
1# ----------------------------------------------------------------------
2#  EXAMPLE: Rappture <image> elements
3# ======================================================================
4#  AUTHOR:  Michael McLennan, Purdue University
5#  Copyright (c) 2004-2005  Purdue Research Foundation
6#
7#  See the file "license.terms" for information on usage and
8#  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
9# ======================================================================
10package require Tk
11package require Rappture
12wm withdraw .
13package require BLT
14
15# open the XML file containing the run parameters
16set driver [Rappture::library [lindex $argv 0]]
17
18set data [$driver get input.image.current]
19set angle [$driver get input.(angle).current]
20set angle [Rappture::Units::convert $angle -to deg -units off]
21
22set imh [image create picture -data $data]
23set dest [image create picture]
24$dest rotate $imh $angle
25
26$driver put output.image(outi).about.label "Rotated Image"
27$driver put output.image(outi).current [$dest export jpg]
28
29# add a little html note
30set htmltext "html://<p style=\"text-align: center;\"><a href=\"angles.html\">Learn more about angles...</a></p>"
31$driver put output.image(outi).note.contents $htmltext
32
33# save the updated XML describing the run...
34Rappture::result $driver
35exit 0
Note: See TracBrowser for help on using the repository browser.