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

Java image resize, 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

Automatic rescaling of an application on high-dpi Windows platform?

Applications that use fixed coordinates and sizes will look small on high-DPI resolutions. Although even if using layouts there are some issues regarding element and font sizes and margins. Fortunately there is support for high-DPI displays since Qt 5.4 as there has been many high-DPI issue fixes. An application on Windows can assume one of … Read more