Command/clip

From ConTeXt wiki
< Command
Revision as of 14:40, 15 October 2019 by Usonianhorizon (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

\clip

Syntax (autogenerated)

\clip[...=...,...]{...}
...=...,...inherits from \setupclipping
{...}CONTENT


Syntax

\clip[...,...=...,...]{...}
[...,...=...,...] see \setupclipping
{...} text and/or image

Description

\setupclipping[nx=, ny=] specifies that \clip should pretend that the picture is cut into nx by ny pieces. \clip[x=, y=] then displays the piece at row x and column y, counting from the top left.

Example

% Tell ConTeXt where to find the windmill picture
\setupexternalfigures[location={default}]

%
\setupclipping[nx=3,ny=3]

This is a thumbnail of the windmill:
\externalfigure[mill][width=1cm]

\blank[line]

This is the bottom row:
\hbox{%
    \clip[x=1, y=3]{\externalfigure[mill]} % <-- space between clips
    \clip[x=2, y=3]{\externalfigure[mill]}% <-- no space between clips
    \clip[x=3, y=3]{\externalfigure[mill]}
}

The leftmost square of the bottom row, shrunken and framed: \framed{
  \scale[sx=0.5,sy=0.5]{\clip[x=1, y=3]{\externalfigure[mill]}}
}

It's not just figures that can be clipped:
\scale[sx=3, sy=3]{\clip[x=1, y=3]{XYZ-ZYX-XYX-}}

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: