简体   繁体   English

如何在不损失质量的情况下缩放界面大小?

[英]How to scale size of interface without losing quality?

Because I cannot see small letters I set windows display to 150%.因为看不到小写字母,所以我将 windows 显示设置为 150%。 All things on my monitor are resized without losing quality.我显示器上的所有东西都在不损失质量的情况下调整大小。 But unfortunately, it doesn't happen with Java Swing interface.但不幸的是,Java Swing 接口不会发生这种情况。 Indeed, the Swing interface is scaled, but it has a wrong quality.确实,Swing 接口是按比例缩放的,但质量有问题。

Can somebody help me to solve it?有人可以帮我解决吗?

Depending on what exactly you mean by "quality", but you can set rendering hints with several options, eg anti-aliasing:取决于“质量”的确切含义,但您可以使用多个选项设置渲染提示,例如抗锯齿:

public void paint (graphics g){
    Graphics2D g2 = (Graphics2D)g;
    RenderingHints rh = new RenderingHints(
             RenderingHints.KEY_TEXT_ANTIALIASING,
             RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    g2.setRenderingHints(rh);
...
}

There are several of these hints, you can find a list here .有几个这样的提示,你可以在这里找到一个列表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不损失质量的情况下缩放屏幕截图? - how to scale screenshot with out losing quality? 如何在不损失图像质量的情况下使图像尺寸适合设备屏幕尺寸? - How to to fit the image size to device screen size without losing image quality? 如何使用php或任何其他语言减小图像文件大小而又不损失质量或分辨率? - How to reduce Image file size without losing quality or resolution using php or any other language? 如何缩小BufferedImage的大小和质量? - How to scale down the size and quality of an BufferedImage? 图像在android中丢失质量和大小? - Image losing quality and size in android? 缩放EditText而不损失质量? - zooming EditText without losing quality? 如何在Java中放大图像而不损失质量? - How might I enlarge image in java without losing quality? 如何在不损失画质的情况下根据宽高比调整图像大小? - How to resize image according to aspect ratio without losing quality? 如何使用Java调整图像大小而不损失质量? - How to resize a image without losing quality using java? JavaFX如何在不损失质量的情况下使用和缩放图像/图标? - JavaFX How to use and scale an image/icon without quality loss?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM