overlay at given position: help needed
![](https://secure.gravatar.com/avatar/cedc4d83943006afe3994fb0a0455f82.jpg?s=120&d=mm&r=g)
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/
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/cedc4d83943006afe3994fb0a0455f82.jpg?s=120&d=mm&r=g)
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/
participants (2)
-
Peter Münster
-
Wolfgang Schuster