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
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
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"
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
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 -------------------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Patrick Gundlach
-
Severin Obertuefer