29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

194<br />

Hello<br />

Hello<br />

8.3 Clipping<br />

In this section we will use the graphic representation (although simplified) of a Dutch cow to<br />

demonstrate clipping.<br />

Figure 8.2 A cow.<br />

Since this cow is defined as a METAPOST graphic, we use the suffix mps instead of eps or a number,<br />

although CONTEXT will recognize each as being METAPOST output. The placement of the cow is<br />

defined as:<br />

\placefigure<br />

{A cow.}<br />

{\externalfigure[cow.mps][width=4cm]}<br />

Clipping is combined with a matrix, as in figure 8.3. The content to be clipped is divided in nx by<br />

ny rectangles. For instance, nx=5 and ny=8 will produce a 40 cell grid with 5 columns of 8 rows.<br />

1,1 3,1<br />

Figure 8.3 A clipped cow.<br />

Here we have divided the cow in six cells, so that we can clip its head and tail. This kind of clipping<br />

enables you to zoom in or focus on a specific part of a graphic.<br />

\setupclipping[nx=3,ny=2]<br />

\startcombination<br />

{\clip[x=1,y=1]{\externalfigure[cow.mps][width=4cm]}} {1,1}<br />

{\clip[x=3,y=1]{\externalfigure[cow.mps][width=4cm]}} {3,1}<br />

\stopcombination<br />

Alternatively, we can specify a width, height, hoffset and voffset, as demonstrated in figure 8.4.<br />

Special effects Clipping

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!