Changes

Jump to navigation Jump to search
749 bytes added ,  08:27, 5 September 2021
}}
== [[Help:Reference|Syntax]] (autogenerated) ==
<syntax>setupclipping</syntax>
== [[Help:Reference|Syntax]] ==
<table cellspacing="4" cellpadding="2" class="cmd">
</tr>
</table>
 
== Description ==
<pre>Clip methodSpecify the default clipping settings. There are three methods:
A) Tiles, where* <code>nx</code>, <code>ny: tiles </code> specify to cut the contents to into <code>nx horizntal </code> horizontal (<code>ny </code> vertical) pieces of equal sized piecessize, and* <code>x</code>, <code>y : </code> choose the piece at x (, y) piece.
B) size/offset, where* <code>width</code>, <code>height: </code> specify the horizontal (vertical) size of the clipping window, and* <code>hoffset</code>, v offset<code>voffset</code>: window shift
C) metapost path
* <code>mp</code>:(see example below)
</pre>
 
== Example ==
To clip, from page 3 of a PDF, a piece of 60x25, 25 mm from the left edge of the paper and 18+25 mm from the top (assuming A4 paper):
<texcode>
\starttext
\startTEXpage
\clip
[width=60mm, height=25mm, hoffset=25mm, voffset=\dimexpr 297mm-18mm-25mm\relax] {\externalfigure[file.pdf][page=3]}%\stopTEXpage\stoptext
</texcode>
To clip a picture to a circle (from the MetaFun manual):
 
<texcode>
\startMPclip{circleclip}
clip currentpicture to fullcircle shifted (.5,.5)
xscaled \width yscaled \height ;
\stopMPclip
 
\clip[nx=1,ny=1,mp=circleclip]{\externalfigure[hacker.png]}
</texcode>
== See also ==
[[* {{cmd:clip|\clip]]}}
== Help from ConTeXt-Mailinglist/Forum ==
All issues with:
{{Forum|{{SUBPAGENAME}}}}
[[Category:CommandsCommand/FiguresImages|setupclipping]]
57

edits

Navigation menu