Description: |
The /image/ read /file/ -from x1 y1 x2 y2 command does
not work correctly. The following script uses the
ActiveTcl example gif of the earth from space. The
rectangular region (152,62) to (185,97) encloses
Madagascar. The displayed region is from the top-right
hand corner.
package require Tk
set fname C:/Tcl8.4/demos/Tk8.4/images/earth.gif
canvas .c
pack .c
set img [image create photo]
$img read $fname -from 152 62 185 97
.c create image 0 0 -anchor nw -image $img
|
User Comments: |
alastair_davies added on 2006-10-13 19:45:05:
Logged In: YES
user_id=988604
Just for comparison, here is the equivalent /image/ copy
/image/ -from x1 y1 x2 y2 code, which does work correctly.
package require Tk
set fname C:/Tcl8.4/demos/Tk8.4/images/earth.gif
canvas .c
pack .c
set img1 [image create photo -file $fname]
set img2 [image create photo]
$img2 copy $img1 -from 152 62 185 97
.c create image 0 0 -anchor nw -image $img2
|