Image Generation for varying sizes.
I am writing an image generation web app. The user can request an image from a set of different sizes (small, medium, etc.) and have a custom text (for logo), format, etc, etc. Here is what I was doing.On request I am creating an image of some default width and height and drew some graphic objects (string, etc with some hard-coded font size and stroke size) that fits perfectly.
then finally using AffineTransform.to get image of the required size from the previously generated image. If the requested dimensions are closer to my defaults then the image is ok, otherwise its blurred. How to get around this?
Ideally I would like to create the image from start with the requested dimensions then I need a way to figure out what appropriate fontsize and stroke etc. to be used for various graphic objects within the image. Is there a way?
Also how do we justify text (center, etc.) in an image?