Mojca Miklavec wrote:
On 5/23/05, Thomas A. Schmitz <[EMAIL PROTECTED]> wrote:


I am still at a loss how to achieve one thing in ConTeXt that was
pretty easy in Keynote or (shudder) Powerpoint: When I wanted to
highlight something on a map or a picture, I would just draw a red
circle around it. What would be the proper way to do this in ConTeXt?
Adding a layer with a red circle drawn in Metapost, then positioning
it by trial and error? Or can anyone point to a better solution?


What kind of picture do you have? If you have .jpg/.png/..., you can
get (x,y) position of the pixel where the center of circle should be.

One possibility is to create a new metapost figure and draw the circle
on it using the measured coordinates:

(This circles the blue tulip on
http://contextgarden.net/images/6/65/Kochloewe_c.jpg.)

\setupcolors[state=start]
\starttext
\startuseMPgraphic{CircleBlueTulip}
        % center point
        pair size, c;
        % figure will be 10 cm wide
        scale := 10cm/400;
        
        % center of the blue tulip is on (219,333), image is 400*460
        size := (400,460) scaled scale;
        c := (222,460-330) scaled scale;
        % diameter of the circle should be 50 pixels
        d := 50scale;

        pickup pencircle scaled 2pt;

        externalfigure "Kochloewe_c.jpg" xyscaled size;
        draw fullcircle scaled d shifted c withcolor red;
\stopuseMPgraphic

\useMPgraphic{CircleBlueTulip}

\stoptext

I believe there exists a more straightforward way if you make
uniqueMPgraphic and specify coordinate fractions of the circle to be
drawn, but if you say:

\framed[background=SomeGraphicWithACircle]{\externalfigure[Kochloewe_c][width=10cm]},
the circle (if any) is drawn behind the figure and cannot be used as
such. Unless you specify the figure in a new layer and draw both
layers in the proper order.

In this case it would be fine to have a \framed[...foreground=...] command :)

Use

\framed
  [background={foreground,BgFront}]
  {\externalfigure[Kochloewe_c][width=10cm]}}

Define your picture as BgFront. 'foreground' is fixed word that identifies layer 0 (text). So you can stack bacground as follow:
  background={...,MyLayer-2,MyLayer-1,foreground,MyLayer1,MyLayer2,...}

Vit
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to