ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster@gmail.com>
To: mailing users <ntg-context@ntg.nl>
Subject: Scale figure to fill a box
Date: Sun, 04 Feb 2018 17:35:50 +0100	[thread overview]
Message-ID: <5A773666.7090901@gmail.com> (raw)

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

                 reply	other threads:[~2018-02-04 16:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5A773666.7090901@gmail.com \
    --to=wolfgang.schuster@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).