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 | # ====================================================================== |
---|
10 | package require Tk |
---|
11 | package require Rappture |
---|
12 | wm withdraw . |
---|
13 | package require BLT |
---|
14 | |
---|
15 | # open the XML file containing the run parameters |
---|
16 | set driver [Rappture::library [lindex $argv 0]] |
---|
17 | |
---|
18 | set data [$driver get input.image.current] |
---|
19 | set angle [$driver get input.(angle).current] |
---|
20 | set angle [Rappture::Units::convert $angle -to deg -units off] |
---|
21 | |
---|
22 | set imh [image create picture -data $data] |
---|
23 | set 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 |
---|
30 | set 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... |
---|
34 | Rappture::result $driver |
---|
35 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.