Changes

Jump to navigation Jump to search
2,287 bytes added ,  13:11, 5 November 2021
Created page with "Documentation for \clip"
<cd:commandgroup name="clip" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>The command <tt>\clip</tt> is used for showing only parts of an object.
</cd:shortdesc>
<cd:variants>
<cd:command category="graphics" file="grph-trf.mkiv" interfacedate="2020-06-19T13:41" interfacefile="i-clipping.xml" level="document" name="clip" variantnumber="1">
<cd:arguments>
<cd:assignments list="yes" optional="yes" ordinal="1">
<cd:assignmentsdoc></cd:assignmentsdoc>
<cd:inherit name="setupclipping"></cd:inherit>
</cd:assignments>
<cd:content ordinal="2"></cd:content>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>{{cmd|setupclipping|2=[nx=,ny=]}} specifies that <code>\clip</code> should pretend that the picture is cut into <code>nx</code> by <code>ny</code> pieces. <code>\clip[x=,y=]</code> then displays the piece at row ''x'' and column ''y'', counting from the top left.
</cd:description>
<cd:examples><cd:example title=""><context source="yes">
% 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]}}
}
</context>

</cd:example><cd:example title="">It's not just figures that can be clipped:
<context source="yes">
\startframedtext[frame=on]
\vbox{\input zapf }
\blank
\clip[nx=3,ny=3,x=1,y=3]{\vbox{\input zapf}}
\blank
\stopframedtext
</context></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:commandref name="setupclipping" originator="system"></cd:commandref>
<cd:source file="grph-trf.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Graphics"></cd:wikipage>
<cd:commandref name="scale"></cd:commandref>
<cd:commandref name="rotate"></cd:commandref>
<cd:wikipage page="Scaling Rotating Mirroring Clipping"></cd:wikipage></cd:seealso>
</cd:commandgroup>

Navigation menu