My program utilizes various images of different sizes. I want to organize these images so that they all fit into a predetermined space without resizing any of them. They need to be organized in such a way to use as much of the predetermined space as possible.

I guess it would be like organizing photos in one of those old photo albums (with the translucent, mildly adhesive, peel-back plastic sheet that held the photos in place) so that you could get as many photos on a page as possible.

Or you could think of it sort of like Tetris? Except all the pieces are rectangles.

How would I do this?

I assume I would use a recursive function to loop through all the images to find out if they fit or not, then returning the best outcome?

I tried searching for code samples but searching for Organizing Images or Organizing Shapes gives less than desirable results.

Thanks.