beetlebug▾
/

ztk::photo crop

Cuts a region out of a photo.

ztk::photo crop SRC DST X1 Y1 X2 Y2

Description

The region from X1 Y1 to X2 Y2, the end not counted, as -from of data. The region is inside SRC.

Returns

An empty string.

Examples

% image create photo c -width 3 -height 1
> c put {{red green blue}}
> ztk::photo crop c c 1 0 3 1
> list [image width c] [c get 0 0]
2 {0 128 0}

Errors

% image create photo c2 -width 4 -height 2; ztk::photo crop c2 c2 0 0 5 1
the region 0 0 5 1 is outside the image of 4 by 2
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.10