* clipping a MetaPost graphic
@ 2003-04-12 17:48 Severin Obertuefer
2003-04-13 15:45 ` Patrick Gundlach
2003-04-13 18:52 ` Hans Hagen
0 siblings, 2 replies; 4+ messages in thread
From: Severin Obertuefer @ 2003-04-12 17:48 UTC (permalink / raw)
hi all
I made a MetaPost graphic and I want to use this graphic for a background.
The graphic is too large and I want to clip it to the size of 84mm width and
54mm height. With
"clip currentpicture to unitsquare xyscaled (86mm,54mm)"
I get the size I wanted but the clipped field should be placed in the center
of the currenpicture. I tried:
"clip currentpicture to unitsquare xyscaled (86mm,54mm) shifted center
boundingbox currentpicture"
but that became not the effect I wanted.How can I shift the clipping area to
the center of the currenpicture?
thx for help
severin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: clipping a MetaPost graphic
2003-04-12 17:48 clipping a MetaPost graphic Severin Obertuefer
@ 2003-04-13 15:45 ` Patrick Gundlach
2003-04-13 16:48 ` Severin Obertuefer
2003-04-13 18:52 ` Hans Hagen
1 sibling, 1 reply; 4+ messages in thread
From: Patrick Gundlach @ 2003-04-13 15:45 UTC (permalink / raw)
Hello Severin,
I don't know if my solution is clever or even working for you, but
since I did not find any answer, this hack might be better then
nothing:
path clippath;
clippath:= unitsquare xyscaled (8cm,8cm) ; % your size here
clip currentpicture to clippath shifted - .5urcorner(clippath);
I hope that the MP-experts shout out loud and show (me) a nicer
solution.
Patrick
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: clipping a MetaPost graphic
2003-04-13 15:45 ` Patrick Gundlach
@ 2003-04-13 16:48 ` Severin Obertuefer
0 siblings, 0 replies; 4+ messages in thread
From: Severin Obertuefer @ 2003-04-13 16:48 UTC (permalink / raw)
Hi Patrick
thx for help, but something with your solutin is wrong.
the clipped picture is to small after clipping.
But I found out something that does the thing I wantet, it looks like this:
path c; c:= unitsquare xyscaled (86mm,54mm) ;
clip currentpicture to c shifted (center currentpicture-center c);
thanks anyway :), greez severin
----- Original Message -----
From: "Patrick Gundlach" <pg@levana.de>
To: <ntg-context@ntg.nl>
Sent: Sunday, April 13, 2003 5:45 PM
Subject: [NTG-context] Re: clipping a MetaPost graphic
> Hello Severin,
>
> I don't know if my solution is clever or even working for you, but
> since I did not find any answer, this hack might be better then
> nothing:
>
> path clippath;
> clippath:= unitsquare xyscaled (8cm,8cm) ; % your size here
> clip currentpicture to clippath shifted - .5urcorner(clippath);
>
> I hope that the MP-experts shout out loud and show (me) a nicer
> solution.
>
> Patrick
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: clipping a MetaPost graphic
2003-04-12 17:48 clipping a MetaPost graphic Severin Obertuefer
2003-04-13 15:45 ` Patrick Gundlach
@ 2003-04-13 18:52 ` Hans Hagen
1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2003-04-13 18:52 UTC (permalink / raw)
Cc: Context Mailing List
At 19:48 12/04/2003 +0200, Severin Obertuefer wrote:
>hi all
>
>I made a MetaPost graphic and I want to use this graphic for a background.
>The graphic is too large and I want to clip it to the size of 84mm width and
>54mm height. With
>"clip currentpicture to unitsquare xyscaled (86mm,54mm)"
xysized(...,...)
since xyscaled depend to much on the curren dimensions
>I get the size I wanted but the clipped field should be placed in the center
>of the currenpicture. I tried:
>
>"clip currentpicture to unitsquare xyscaled (86mm,54mm) shifted center
>boundingbox currentpicture"
currentpicture := currentpicture shifted -center currentpicture ;
or
currentpicture := currentpicture shifted - llcorner currentpicture ;
may help, depending on where your ref point is located
first shift, them clip to fullsquare (instead of unitsquare)
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
information: http://www.pragma-ade.com/roadmap.pdf
documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-04-13 18:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-12 17:48 clipping a MetaPost graphic Severin Obertuefer
2003-04-13 15:45 ` Patrick Gundlach
2003-04-13 16:48 ` Severin Obertuefer
2003-04-13 18:52 ` Hans Hagen
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).