I'm working on an application to help create printed-page layouts (to be then fed into a custom script for InDesign). I'm facing a problem regarding placing images on a page. Either a single image could be placed on a page, or multiple images.
- If a single image is placed, the user should be able to define whether it's placed at the top center, or middle of the page
- if two images, the user defines either top/bottom or left/right - though top/bottom would make much sense for two portrait images, so I'd like a way to enforce left/right for portrait and vice versa for landscape images
- if three images, the user defines top/middle/bottom or left/center/right.
This is fairly basic, but I want to throw in the ability to define grid-based layouts. That is, maybe a full width top image, with a left/right image below and so on.
I'm having difficulty envisioning the best approach to do this.
At the moment, I have a
PhotoPage object, with an array of
Images, which has a placement enum for each image, however this falls apart for grid-based layouts. I was hoping someone could shed some more light on solving this placement problem, other than calculating the exact geometry for each image and sending that to the InDesign script.