我需要弄清楚缩放比例设置为什么。 Windows scaling处的答案给出了c / c ++ / c#中的代码,但是我需要Java中的代码,并且非常愿意不必执行JNI。是否可以使用JNA来获取该信息?
答案 0 :(得分:0)
这似乎可以做到:
GraphicsConfiguration asdf = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
AffineTransform asfd2 = asdf.getDefaultTransform();
double scaleX = asfd2.getScaleX();
double scaleY = asfd2.getScaleY();
原谅错误的变量名。而不是默认值,您可能需要考虑多个显示。但这说明了它是可以做到的。