source: trunk/examples/zoo/image/image.tcl @ 3177

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