Kjell Magne Fauske | 1 Feb 13:04
Picon

Re: Alignment/overlay of images and rectangles using TikZ in beamer

On Feb 1, 2008 11:47 AM, msu79 <martin <at> suklitsch.at> wrote:
>
> Hi there!
>
>
> I'm - meanwhile rather desperately - trying to solve the following task:
> I've defined an image to be 0.8\paperwidth. Now I want to display this image
> on a slide and then overlay some rectangles for clarification.
>
> One way I tried to accomplish this was:
>   \begin{tikzpicture}{remember picture,overlay}
>     \pgfuseimage{precrbias}
>   \end{tikzpicture}
>   \only <2> {  \begin{tikzpicture}{remember picture,overlay}
>     \draw[red,overlay] (1,1) rectangle (1.5,1.5);
>     \draw[blue,overlay] (2.5,2.5) rectangle (1,1);
>     \draw[green,overlay] (5,5) rectangle (2.5,2.5);
>   \end{tikzpicture}}
>
> (don't wonder about the coordinates, I'm just playing around so far)
>
> With that I ended up having the image aligned at the center of the frame,
> and the rectangles were where I wanted to have them.
>
> In a second try, I put the image into a node, so "\node {
> \pgfuseimage{precrbias} };". Now, the image was properly aligned, but the
> rectangles show up next to it.
>
> Putting the image outside any tikzpicture environment did not work either!
>
> Any suggestions on what to do next?
>
> Best regards,
> Martin
>
> --

This recent thread on this mailing list should be of help:
http://www.nabble.com/Tkz-overlays-td14781565.html#a14856013

You can put everything in the same tikzpicture environment. Not sure
if \only works inside a tikzpicture environment. You can instead try:

 \path<2> [draw,red] (1,1) rectangle (1.5,1.5);
 \path<2> [draw,blue] (2.5,2.5) rectangle (1,1);
...

- Kjell Magne Fauske

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Gmane