* 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
* Re: overlay at given position: help needed
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
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2010-02-05 9:31 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 04.02.10 23:11, schrieb Peter Münster:
> 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.
>
What is the expected output from your code with the left and top keys?
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: overlay at given position: help needed
2010-02-05 9:31 ` Wolfgang Schuster
@ 2010-02-05 10:27 ` Peter Münster
0 siblings, 0 replies; 3+ messages in thread
From: Peter Münster @ 2010-02-05 10:27 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Fri, Feb 05 2010, Wolfgang Schuster wrote:
>> 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.
>>
> What is the expected output from your code with the left and top keys?
Hello Wolfgang,
When top=0 and left=0, the image should be centred in the text area.
With top=0.5 it should be centred in the bottom half.
With top=0.5 and left=0.5 it should be centred in bottom right quarter.
And so on.
("top" and "left" should be probably replaced by "hoffset" and "voffset")
Another idea comes to my mind:
text text text
text text text text text text
text text text text text text text text text
text text text text text text
text \placeanchor[myanchorname][hoffset=2cm, voffset=-1cm] text text text
text text text text text
text text text text text text text text
\placeatanchor[myanchorname]{\externalfigure[...]}
That means: I would like to define a position somewhere in the text,
perhaps some distance away from the actual point (hoffset and voffset).
And afterwards, I place an image at exactly that position as background.
This way, I can probably use the \FlushStep command.
I've looked quickly into the details.pdf but it all seems to be related to
floats...
TIA for any help!
Cheers, Peter
--
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).