[NTG-context] Scale figure to fill a box

Wolfgang Schuster wolfgang.schuster at gmail.com
Sun Feb 4 17:35:50 CET 2018


Hi Hans,

I want to use a few graphics as page backgrounds but with the \scale command
the image always stays within the borders of the page.

Can you add a command (probably easier than adding such a function to 
\scale)
which does as same as in the second row of the example below where the image
extends outside of the borders of the frame. A option to clip parts – 
which can be
disabled – of the image which are outside of the frame would be a nice 
extension
to this command (e.g. in case you want a image in a table cell).


\setupexternalfigure[location=default]

\defineframed
   [PageBorder]
   [offset=overlay,
    rulethickness=2pt,
    framecolor=red,
    width=6cm,
    height=6cm]

\starttext

\startcombination[nx=2,ny=1,distance=4cm]
   {\PageBorder{\externalfigure[hacker][factor=fit]}}{}
   {\PageBorder{\externalfigure[mill]  [factor=fit]}}{}
\stopcombination

\blank[4cm]

\startcombination[nx=2,ny=1,distance=4cm]
   {\PageBorder{\clap{\externalfigure[hacker][height=6cm]}}}{}
   {\PageBorder      {\externalfigure[mill]   [width=6cm]}}  {}
\stopcombination

\stoptext


Wolfgang


More information about the ntg-context mailing list