我如何确定图形的位置(成对)(左下角和右上角)?

我如何确定图形的位置(成对)(左下角和右上角)?
settings.tex="pdflatex"; // This command is very important!

unitsize(1cm);

// PNG file
label(graphic("image2.png" ,"width=3cm"),(0,0)); // in the same folder.
draw(box((-3,-3),(3,3)));
// JPG file
label(graphic("image1.jpg" ,"width=3cm"),(5,0));
// Asymptote code
picture pic;
unitsize(pic,1cm);
draw(pic,Label("Some texts",Relative(.75)),circle((0,0),1));
add(pic.fit(),(9,0));
// PDF file
label(graphic("image4.pdf" ,"width=3cm"),(15,0));

layer();
// The layer() function can be used to force future objects to be
// drawn on top of the included image

draw(scale(.5)*Label("Some text",LeftSide),(0,0)--(5,0),Arrow,Margin(.5cm,.45cm));
draw(scale(.5)*Label("Some text",LeftSide),(5,0)--(9,0),Arrow,Margin(.35cm,.35cm));
draw(scale(.5)*Label("Some text",LeftSide),(9,0)--(15,0),Arrow,Margin(.4cm,.5cm));

shipout(bbox(2mm,Fill(white)));

在此处输入图片描述

问题:

我如何确定图形(左下角和右上角)的位置(成对)currentpicture

(可以替换两张不同的图片)

答案1

像这样吗?

在此处输入图片描述

settings.tex="pdflatex"; 
real usize=1cm;
unitsize(usize);
picture img;
img.unitsize(usize);
label(img,graphic("image1.png", "width=3cm"),(0,0));
add(img);
dot(min(img)/usize,blue+4*bp);
dot(max(img)/usize,red+4*bp);

相关内容