Changeset 1932 for branches/blt4/gui/scripts/imageentry.tcl
- Timestamp:
- Oct 25, 2010 3:16:06 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/gui/scripts/imageentry.tcl
r1923 r1932 151 151 set newval [lindex $args 0] 152 152 if {[string length $newval] > 0} { 153 set imh [image create p hoto-data $newval]153 set imh [image create picture -data $newval] 154 154 } else { 155 155 set imh "" … … 176 176 set fmt [$_owner xml get $_path.convert] 177 177 if {"" != $fmt && "" != $_imh} { 178 if {"pgm" == $fmt} { set fmt "ppm -grayscale" } 179 set bytes [eval $_imh data -format $fmt] 180 set bytes [Rappture::encoding::decode -as b64 $bytes] 178 switch -- $fmt { 179 "pgm" - "ppm" { 180 $_imh export pbm -data bytes 181 } 182 "jpeg" { 183 $_imh export jpg -data bytes 184 } 185 "tiff" { 186 $_imh export tif -data bytes 187 } 188 "bmp" - "png" - "xbm" - "xpm" { 189 $_imh export $fmt -data bytes 190 } 191 default { 192 error "unknown image format \"$fmt\"" 193 } 194 } 181 195 } 182 196 return $bytes
Note: See TracChangeset
for help on using the changeset viewer.