Changes

Jump to navigation Jump to search
warning about clipping
<context source=yes>
\ss Next generation L\rotate{m}\rotate{m}TSP3AlTSP\mirror{3}Al\rotate[rotation=270,location=high]{v}?
</context>
\stoptext
</texcode>
 
or, even nicer:
 
<context source="yes">
\useMPlibrary[dum]
\setupexternalfigures[width=4em,height=3em,frame=on,]
\dostepwiserecurse{0}{359}{45}{{\bf\recurselevel˚}\quad
\doloopoverlist{normal,depth,fit,broad,high,middle}{
\dontleavehmode\ruledhbox{%
\rotate[rotation=\recurselevel, location=\recursestring]{%
\externalfigure[\recursestring]
}%
}%
}\par
}
</context>
==In a box==
=Clipping=
You can adjust the size of an element by cropping/clipping its borders:<ref>Please, don’t forget that clipping only displays a part of an image. At least when this comes from a PDF document, the whole page has to be included, although only part of it is displayed.<br/>The PDF output from the following sample contains <code>hans hagen, pragma ade</code>. Depending on your PDF viewer, you may be able to search for it.<br/>Of course, you will have to compile the source yourself, since the wiki will only contains PNG images from compilations.  <context source="yes">\setuppapersize[A5, landscape]\setuplayout[page]\starttext\clip[nx=3,ny=3,x=1,y=1]{\externalfigure[xml-mkiv.pdf]}\stoptext</context></ref>
<context source="yes">
<context source="yes">
\setupcolors[state=start]
\definedfont[SansBold at 20mm]
\baselineskip 0pt % switch off the space between the stripes
\lineskip 0pt
\def\MyLogo{\vbox{\hbox{\CONTEXT}\null}} % null is necessary for the whole bounding box
\clip[ny=3,y=1]{\color[yellow]{\MyLogo}}\clip[ny=3,y=2]{\color[orange]{\MyLogo}}\clip[ny=3,y=3]{\color[red]{\MyLogo}}</context> And here’s how to cut out a piece by measures (see also {{cmd|setupclipping}} and {{cmd|clip}}): <context source="yes">\clip[width=3cm, height=1cm, hoffset=1cm, voffset=5mm]{\externalfigure[cow][width=5cm]}
</context>
The example shows only the case “split into a grid of parts“; it’s also possible to cut out a piece by measures;
see also {{cmd|setupclipping}} and {{cmd|clip}}.
=Further reading=
Graphic transformations are implemented in [https://source.contextgarden.net/tex/context/base/mkiv/grph-trf.mkiv grph-trf.mkiv] and [https://source.contextgarden.net/tex/context/base/mkiv/grph-trf.lua grph-trf.lua].
 
=Footnotes=
[[Category:Basics]]
[[Category:Graphics]]
139

edits

Navigation menu