Metapost:缩放图片

Metapost:缩放图片

如果我定义了一个picture,我该如何按比例因子缩放图片?例如,如果比例因子为 5,则目标将是定义 的大小的 5 倍picture。比例因子可能小于 1。picture可能很复杂。它类似于zoom inzoom out定义的图片。抱歉,我无法提供最小代码。

答案1

你可以这样做<picture> scaled <numeric>。以 Metapost 手册中的一个例子为例:

beginfig(22);
path a, b, aa, ab;
a = fullcircle scaled 2cm;
b = a shifted (0,1cm);
aa = halfcircle scaled 2cm;
ab = buildcycle(aa, b);
picture pa, pb;
pa = thelabel(btex $A$ etex, (0,-.25cm));
pa := pa scaled 2;
pb = thelabel(btex $B$ etex, (0,1.5cm));
fill a withcolor .7white;
fill b withcolor .7white;
fill ab withcolor .4white;
unfill bbox pa;
draw pa;
unfill bbox pb;
draw pb;
label.lft(btex $U$ etex, (-1cm,.5cm));
draw bbox currentpicture;
endfig;
end.

在此处输入图片描述

相关内容