我想创建一个 TreeMap的
,用图片填写树形
矩形。我可以假设所有的图片具有相同的宽度和高度(即纵横比)。因此,我需要一个 treemapping
算法与给定的比例创建矩形,我就能把照片存在(也许缩放图片,如果我需要)。
I would like to create a TreeMap
, using pictures to fill out the treemap
rectangles. I can assume that all the pictures have the same width and height (i.e. the aspect ratio). Thus, I need a treemapping
algorithm to create the rectangles with a given ratio, do I will be able to put the pictures there (and perhaps scale the pictures if I need).
您能否推荐一个?
在一般情况下,一个解决方案是不可能的 - 阿尔宾Sunnanbo提供了证明由反例。假设你的边框有相同的宽高比为目标矩形,你也许可以通过缩放边框是一个正方形,运行的