Difference between revisions of "Command/setupclipping"
< Command
Jump to navigation
Jump to search
(Create reference page) |
|||
(14 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
{{Reference | {{Reference | ||
|name=setupclipping | |name=setupclipping | ||
Line 6: | Line 4: | ||
}} | }} | ||
+ | == [[Help:Reference|Syntax]] (autogenerated) == | ||
+ | <syntax>setupclipping</syntax> | ||
== [[Help:Reference|Syntax]] == | == [[Help:Reference|Syntax]] == | ||
<table cellspacing="4" cellpadding="2" class="cmd"> | <table cellspacing="4" cellpadding="2" class="cmd"> | ||
Line 12: | Line 12: | ||
</tr> | </tr> | ||
<tr valign="top" class="first"> | <tr valign="top" class="first"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:nx|nx]]</td> |
− | <td>[[ | + | <td>[[Command/value:number|number]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="first"> | <tr valign="top" class="first"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:ny|ny]]</td> |
− | <td>[[ | + | <td>[[Command/value:number|number]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="first"> | <tr valign="top" class="first"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:x|x]]</td> |
− | <td>[[ | + | <td>[[Command/value:number|number]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="first"> | <tr valign="top" class="first"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:y|y]]</td> |
− | <td>[[ | + | <td>[[Command/value:number|number]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="first"> | <tr valign="top" class="first"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:width|width]]</td> |
− | <td>[[ | + | <td>[[Command/value:dimension|dimension]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="first"> | <tr valign="top" class="first"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:height|height]]</td> |
− | <td>[[ | + | <td>[[Command/value:dimension|dimension]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="first"> | <tr valign="top" class="first"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:hoffset|hoffset]]</td> |
− | <td>[[ | + | <td>[[Command/value:dimension|dimension]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="first"> | <tr valign="top" class="first"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:voffset|voffset]]</td> |
− | <td>[[ | + | <td>[[Command/value:dimension|dimension]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="first"> | <tr valign="top" class="first"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:mp|mp]]</td> |
− | <td>[[ | + | <td>[[Command/value:name|name]] </td> |
</tr> | </tr> | ||
</table> | </table> | ||
− | |||
== Description == | == Description == | ||
− | + | Specify the default clipping settings. There are three methods: | |
− | |||
− | A) Tiles | + | A) Tiles, where |
− | nx, ny | + | * <code>nx</code>, <code>ny</code> specify to cut the contents into <code>nx</code> horizontal (<code>ny</code> vertical) pieces of equal size, and |
− | x, y | + | * <code>x</code>, <code>y</code> choose the piece at x (, y). |
− | B) size/offset | + | B) size/offset, where |
− | width, height | + | * <code>width</code>, <code>height</code> specify the horizontal (vertical) size of the clipping window, and |
− | hoffset, | + | * <code>hoffset</code>, <code>voffset</code>: window shift |
C) metapost path | C) metapost path | ||
− | mp | + | * <code>mp</code>: (see example below) |
− | </ | ||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | |||
− | |||
== Example == | == 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> | |
− | |||
\clip | \clip | ||
− | + | [width=60mm, | |
− | + | height=25mm, | |
− | + | hoffset=25mm, | |
− | + | voffset=\dimexpr 297mm-18mm-25mm\relax] | |
− | + | {\externalfigure[file.pdf][page=3]}% | |
+ | </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 == | == See also == | ||
− | + | * {{cmd|clip}} | |
+ | |||
+ | == Help from ConTeXt-Mailinglist/Forum == | ||
+ | All issues with: | ||
+ | {{Forum|{{SUBPAGENAME}}}} | ||
− | [[Category: | + | [[Category:Command/FiguresImages|setupclipping]] |
Latest revision as of 08:27, 5 September 2021
\setupclipping
Syntax (autogenerated)
\setupclipping[...=...,...] | |
state | start stop |
width | dimension |
height | dimension |
hoffset | dimension |
voffset | dimension |
x | number |
y | number |
nx | number |
ny | number |
sx | number |
sy | number |
leftoffset | dimension |
rightoffset | dimension |
topoffset | dimension |
bottomoffset | dimension |
mp | name |
n | number |
offset | dimension |
Syntax
\setupclipping[...,...=...,...] | |
nx | number |
ny | number |
x | number |
y | number |
width | dimension |
height | dimension |
hoffset | dimension |
voffset | dimension |
mp | name |
Description
Specify the default clipping settings. There are three methods:
A) Tiles, where
nx
,ny
specify to cut the contents intonx
horizontal (ny
vertical) pieces of equal size, andx
,y
choose the piece at x (, y).
B) size/offset, where
width
,height
specify the horizontal (vertical) size of the clipping window, andhoffset
,voffset
: window shift
C) metapost path
mp
: (see example below)
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):
\clip [width=60mm, height=25mm, hoffset=25mm, voffset=\dimexpr 297mm-18mm-25mm\relax] {\externalfigure[file.pdf][page=3]}%
To clip a picture to a circle (from the MetaFun manual):
\startMPclip{circleclip} clip currentpicture to fullcircle shifted (.5,.5) xscaled \width yscaled \height ; \stopMPclip \clip[nx=1,ny=1,mp=circleclip]{\externalfigure[hacker.png]}
See also
Help from ConTeXt-Mailinglist/Forum
All issues with: