Fit n rectangles (images) in another rectangle (window) changing scale...

I'm developing a image viewing program, and I would like to offer the possibility to show all images in a directory as a single window (no scrolling) mosaic, wasting as little space as possible, and in the case the images cannot fit, reduce the scale of all images. In concept, is really similar to the "Expos? functionality in the latest Mac OS X version.

I would appreciate pointers on how to solve this problem. I've been looking into "bin-packing" algorithms, and maybe I could achieve the desired effect making some kind of search applying that algorithm, and if the rectangles cannot be fit then reduce the scale...

Does anyone know if there's a similar feature in any open source program, so I could take a look at the implementation?

Is there any "bin packing approximation" implementation/library in Java?

[842 byte] By [joseprioa] at [2007-10-2 7:23:03]
# 1
You might find something interesting here - http://www.cs.umd.edu/hcil/piccolo/index.shtmlPete
pm_kirkhama at 2007-7-16 20:59:32 > top of Java-index,Other Topics,Algorithms...
# 2
I too need this functionality. Anyone have any ideas as how to do a nice job of solving this or how Apple manages to do it with "Expose" in OS X? Thanks in advance...
thaeeza at 2007-7-16 20:59:32 > top of Java-index,Other Topics,Algorithms...