Last change
on this file since 3177 was
3177,
checked in by mmc, 12 years ago
|
Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.
|
File size:
1.3 KB
|
Line | |
---|
1 | # ---------------------------------------------------------------------- |
---|
2 | # EXAMPLE: Rappture <image> elements |
---|
3 | # ====================================================================== |
---|
4 | # AUTHOR: Michael McLennan, Purdue University |
---|
5 | # Copyright (c) 2004-2012 HUBzero Foundation, LLC |
---|
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 | package require Img |
---|
15 | |
---|
16 | # open the XML file containing the run parameters |
---|
17 | set driver [Rappture::library [lindex $argv 0]] |
---|
18 | |
---|
19 | set data [$driver get input.image.current] |
---|
20 | set angle [$driver get input.(angle).current] |
---|
21 | set angle [Rappture::Units::convert $angle -to deg -units off] |
---|
22 | |
---|
23 | set imh [image create photo -data $data] |
---|
24 | set dest [image create photo] |
---|
25 | blt::winop image rotate $imh $dest $angle |
---|
26 | |
---|
27 | $driver put output.image(outi).about.label "Rotated Image" |
---|
28 | $driver put output.image(outi).current [$dest data -format jpeg] |
---|
29 | |
---|
30 | # add a little html note |
---|
31 | set htmltext "html://<p style=\"text-align: center;\"><a href=\"angles.html\">Learn more about angles...</a></p>" |
---|
32 | $driver put output.image(outi).note.contents $htmltext |
---|
33 | |
---|
34 | # save the updated XML describing the run... |
---|
35 | Rappture::result $driver |
---|
36 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.