2

In one of my Java programs I have designed the following window which is exactly 666 by 669 pixels.

Picture

Is there anyway I can stretch this picture, while keeping the aspect ratio, to the maximum size which any user's screen will allow?

  • [See `Frame#setExtendedState`](https://docs.oracle.com/javase/8/docs/api/java/awt/Frame.html#setExtendedState-int-) – MadProgrammer Jan 02 '18 at 21:57
  • You can also have a look at [maintaining aspect ratio of JPanel background image](https://stackoverflow.com/questions/11959758/java-maintaining-aspect-ratio-of-jpanel-background-image/11959928#11959928) and [Quality of Image after resize very low](https://stackoverflow.com/questions/14115950/quality-of-image-after-resize-very-low-java/14116752#14116752) for more details about scaling. Remember, scaling up will generate a poor image quality, you always better off scaling down where ever possible – MadProgrammer Jan 02 '18 at 21:59
  • Based on you image, it would be relatively easy to generate the the image dynamically at runtime – MadProgrammer Jan 02 '18 at 22:01

0 Answers0