no display name and no $DISPLAY environment variable
    while executing
"load /enadisk/commun/linux/local/ActiveTcl-8.6.11/lib/libtk8.6.so Tk"
    ("package ifneeded Tk 8.6.11" script)
    invoked from within
"load /commun/linux/local/ActiveTcl-8.6.11/lib/Img1.4.6/libtkimgwindow1.4.6.so"
    ("package ifneeded img::window 1.4.6" script)
    invoked from within
"package require img::window"
    ("package ifneeded Img 1.4.6" script)
    invoked from within
"package require Img"
    (in namespace eval "::request" script line 7)
    invoked from within
"namespace eval ::request $script"
    ("::try" body line 12)

OUTPUT BUFFER:

#!/home/moumou/TclTk-8.5/bin/wish8.5 ###!/usr/local/ActiveTcl/bin/wish source /home/ripp/gscope/gscope_outils.tcl package require base64 package require Img wm geometry . +100+100 proc OpacifieImage {img bg {trans 1}} { if {$trans} { set tmp [image create photo] $tmp put [$img data -background $bg] $img blank $img copy $tmp } else { set rgb [winfo rgb . $bg] foreach {r g b} $rgb {} set rgb [list [expr {$r/256}] [expr {$g/256}] [expr {$b/256}]] set w [image width $img] set h [image height $img] for {set i 0} {$i<$w} {incr i} { for {set j 0} {$j<$h} {incr j} { if {[$img get $i $j] == $rgb} { $img transparency set $i $j 1 } } } } update return } proc ImageRotate {img angle} { set angle [expr {fmod($angle, 360.0)}] if {$angle < 0} {set angle [expr {$angle + 360.0}]} if {$angle} { set w [image width $img] set h [image height $img] set tmp [image create photo] $tmp copy $img $img blank set buf {} if {$angle == 90} { # This would be easier with lrepeat set row {} for {set i 0} {$i<$h} {incr i} { lappend row "#000000" } for {set i 0} {$i<$w} {incr i} { lappend buf $row } set i 0 foreach row [$tmp data] { set j 0 foreach pixel $row { lset buf $j $i $pixel incr j } incr i } $img config -width $h -height $w $img put $buf } elseif {$angle == 180} { $img copy $tmp -subsample -1 -1 } elseif {$angle == 270} { # This would be easier with lrepeat set row {} for {set i 0} {$i<$h} {incr i} { lappend row "#000000" } for {set i 0} {$i<$w} {incr i} { lappend buf $row } set i $h foreach row [$tmp data] { set j 0 incr i -1 foreach pixel $row { lset buf $j $i $pixel incr j } } $img config -width $h -height $w $img put $buf } else { set a [expr {atan(1)*8*$angle/360.}] set xm [expr {$w/2.}] set ym [expr {$h/2.}] set w2 [expr {round(abs($w*cos($a)) + abs($h*sin($a)))}] set xm2 [expr {$w2/2.}] set h2 [expr {round(abs($h*cos($a)) + abs($w*sin($a)))}] set ym2 [expr {$h2/2.}] $img config -width $w2 -height $h2 for {set i 0} {$i<$h2} {incr i} { set toX -1 for {set j 0} {$j<$w2} {incr j} { set rad [expr {hypot($ym2-$i,$xm2-$j)}] set th [expr {atan2($ym2-$i,$xm2-$j) + $a}] if { [set x [expr {$xm-$rad*cos($th)}]] < 0 || $x >= $w || [set y [expr {$ym-$rad*sin($th)}]] < 0 || $y >= $h } then { continue } set x0 [expr {int($x)}] set x1 [expr {($x0+1)<$w? $x0+1: $x0}] set dx_ [expr {1.-[set dx [expr {$x1-$x}]]}] set y0 [expr {int($y)}] set y1 [expr {($y0+1)<$h? $y0+1: $y0}] set dy_ [expr {1.-[set dy [expr {$y1-$y}]]}] # This is the fastest way to get the data, because # in 8.4 [$photo get] returns a string and not a # list. This is horrible, but fast... scan "[$tmp get $x0 $y0] [$tmp get $x0 $y1]\ [$tmp get $x1 $y0] [$tmp get $x1 $y1]" \ "%d %d %d %d %d %d %d %d %d %d %d %d" \ r0 g0 b0 r1 g1 b1 r2 g2 b2 r3 g3 b3 set r [expr {round($dx*($r0*$dy+$r1*$dy_)+$dx_*($r2*$dy+$r3*$dy_))}] set g [expr {round($dx*($g0*$dy+$g1*$dy_)+$dx_*($g2*$dy+$g3*$dy_))}] set b [expr {round($dx*($b0*$dy+$b1*$dy_)+$dx_*($b2*$dy+$b3*$dy_))}] lappend buf [format "#%02x%02x%02x" $r $g $b] if {$toX == -1} { set toX $j } } if {$toX>=0} { $img put [list $buf] -to $toX $i set buf {} update } } } image delete $tmp } } # rotate proc proc rotate {in angle {xc ""} {yc ""}} { # xi = + (x - s/2) * cos(-a) + (y - s/2) * sin(-a) + xc # yi = - (x - s/2) * sin(-a) + (y - s/2) * cos(-a) + yc set width [image width $in] set height [image height $in] set w2 [expr {$width / 2}] set h2 [expr {$height / 2}] if {$xc == ""} { set xc $w2 } if {$yc == ""} { set yc $h2 } set ww [expr {abs($width - $xc)}] if {$ww < $xc} { set ww $xc } set hh [expr {abs($height - $yc)}] if {$hh < $yc} { set hh $yc } set size [expr {round(sqrt($ww*$ww+$hh*$hh))}] set sx2 [expr {$size * 2}] set out [image create photo -width $sx2 -height $sx2] set pi2 [expr {acos(0)}] set alpha [expr {$angle * $pi2 / 90.0}] set cos [expr {cos(-$alpha)}] set sin [expr {sin(-$alpha)}] for {set y 0} {$y < $sx2} {incr y} { for {set x 0} {$x < $sx2} {incr x} { set x1 [expr {$x-$size}] set y1 [expr {$y-$size}] set x0 [expr {round(+$x1*$cos + $y1*$sin + $xc)}] set y0 [expr {round(-$x1*$sin + $y1*$cos + $yc)}] if {$x0 >= 0 && $x0 < $width && $y0 >= 0 && $y0 < $height} { if {![$in transparency get $x0 $y0]} { set col [eval format #%2.2x%2.2x%2.2x [$in get $x0 $y0]] } else { set col "#ff0000" } $out put $col -to $x $y } } } return $out } proc CreeFonteAscii {fm sz md} { global Mapc set Lc "abcdefghijklmnopqrstuvwxyz" set LC [string toupper $Lc] append Lc $LC append Lc "0123456789-_ \(\) .,;!:/?\[\]" set Lc [split $Lc ""] foreach c $Lc { pack [label .c -font Myfont -text $c -anchor nw -justify left] raise .c update idletasks # Entre set ph [image create photo] $ph blank $ph put .c -format window for {set i 0} {$i < [image width $ph]} {incr i} { for {set j 0} {$j < [image height $ph]} {incr j} { set col [$ph get $i $j] foreach {r g b} $col {} if {!($r < 5 && $g < 5 && $b < 5)} { $ph transparency set $i $j 1 } } } label .l -image $ph -bg yellow pack .l -side left $ph write toto.gif -format gif image delete $ph destroy .c destroy .l set od [open "toto.gif" r] set input "" fconfigure $od -translation binary set input [read -nonewline $od] close $od file delete -force toto.gif set ec [base64::encode $input] set Mapc($fm,$sz,$md,$c) $ec } return } proc LoadFonteAscii {fm sz md} { global Mapc set l [ContenuDuFichier "FontesGif.asc"] array set Mapc $l font create Myfont -family $fm -size $sz -weight $md return } proc FontePalette {} { global Mapc set i 0 set j 0 grid rowconfig . 0 -weight 0 foreach c [lsort [array names Mapc]] { set cmp [expr $i+$j*20] set i$cmp [image create photo -data [base64::decode $Mapc($c)]] label .l$cmp -image [set i$cmp] -bg cyan if {$i >= 20} { set i 1 incr j grid rowconfig . $j -weight 0 } else { incr i } grid .l$cmp -row $j -column $i -padx 1 -pady 1 } return } proc DetruitToutW {} { Entre foreach w [winfo children .] { destroy $w } return } proc TestTexteTourne {{txt ""} {angle 30.}} { global Mapc if {$txt eq ""} {set txt "Bonjour Lucky67"} set Lt [split $txt ""] pack [canvas .c] set x0 0 set dst [image create photo] foreach c $Lt { set phi [image create photo -data $Mapc(Helvetica,14,bold,$c)] set wdi [expr [image width $phi]-3] set hgi [image height $phi] .c create image $x0 0 -image $phi -anchor nw set i $x0 for {set p 3} {$p < $wdi} {incr p} { for {set j 1} {$j < $hgi} {incr j} { if {! [$phi transparency get $p $j]} { $dst put [eval format #%02x%02x%02x [$phi get $p $j]] -to $i $j } } incr i } incr x0 [expr $wdi-3] } set ori [image create photo] $ori copy $dst $ori write ori.gif -background "#ffffff" -format gif OpacifieImage $dst white ImageRotate $dst $angle OpacifieImage $dst white 0 .c configure -width 500 -height 500 -scrollregion [list 0 0 500 500] .c configure -bg green .c create image 0 30 -image $ori -anchor nw .c create text 0 60 -font Myfont -text $txt -anchor nw -justify left set ItOut [.c create image 0 100 -image $dst -anchor nw] set bb [.c bbox $ItOut] .c create rectangle $bb -fill yellow .c raise $ItOut return } if {0} { foreach fm {Helvetica CourierNew} { foreach sz {6 8 10 12 14} { foreach md {normal bold} { font create Myfont -family $fm -size $sz -weight $md CreeFonteAscii $fm $sz $md font delete Myfont } } } } if {0} { global Mapc set foo [open FontesGif.asc w] puts $foo [array get Mapc] close $foo } LoadFonteAscii Helvetica 14 bold #FontePalette TestTexteTourne "Et Voila Lulu !" -20. Entre exit