Resize image, maintain aspect ratio
Here we go: Dimension imgSize = new Dimension(500, 100); Dimension boundary = new Dimension(200, 200); Function to return the new size depending on the boundary: public static Dimension getScaledDimension(Dimension imgSize, Dimension boundary) { int original_width = imgSize.width; int original_height = imgSize.height; int bound_width = boundary.width; int bound_height = boundary.height; int new_width = original_width; int new_height … Read more