ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* overlay at given position: help needed
@ 2010-02-04 22:11 Peter Münster
  2010-02-05  9:31 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Münster @ 2010-02-04 22:11 UTC (permalink / raw)
  To: ConTeXt list

Hello,

Below is a test file, to show a bit what I'm looking for: a
background-image behind a text-area at a given position relative to the
center of this area. I'm not yet satisfied with the result.

Here my questions:

1.) Is \startframedtext a good choice for placing the background, or is
    there something better?
2.) Is \framed[loffset=..., toffset=...]{} a good choice for specifying the
    position, or is there something better?
3.) When "left=1", why is the image completely outside the frame and not
    only 50%?
4.) How do I make a step between text and background according to
    http://wiki.contextgarden.net/Presentation_effects ?
    I would like to show first the text, and after a mouse-click the
	background image.

Thanks in advance for any help!
Cheers, Peter


The test-file:


% Begins a text-area with a background-image:
\def\startBGimg[#1]{%
  \getparameters[BGimg][top=0, left=0, width=2cm, #1]%
  \start
    \newdimen\TopOffset \newdimen\LeftOffset
    \setupframedtexts[before=, after=]
    \defineoverlay[myBG][{%
        \TopOffset=\overlayheight      \LeftOffset=\overlaywidth
        \TopOffset=\BGimgtop\TopOffset \LeftOffset=\BGimgleft\LeftOffset
        \framed[frame=on, width=\overlaywidth, height=\overlayheight,
          offset=overlay, toffset=\TopOffset, loffset=\LeftOffset]{%
          \externalfigure[\BGimgimg][width=\BGimgwidth]}}]
    \startframedtext[background=myBG, frame=off, offset=overlay,
      width=\textwidth]}

% Stops the text-area with a background-image:
\def\stopBGimg{\stopframedtext\stop}

\starttext
\startBGimg[img=hacker.jpg, top=-1, left=-1]
\input tufte
\stopBGimg

\startBGimg[img=hacker.jpg, top=-1, left=1]
\input tufte
\stopBGimg

\startBGimg[img=hacker.jpg, top=1, left=-1]
\input tufte
\stopBGimg

\startBGimg[img=hacker.jpg, top=1, left=1]
\input tufte
\stopBGimg
\stoptext

-- 
Contact information: http://pmrb.free.fr/contact/


___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-05 10:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-04 22:11 overlay at given position: help needed Peter Münster
2010-02-05  9:31 ` Wolfgang Schuster
2010-02-05 10:27   ` Peter Münster

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).