如何在XFCE桌面环境上使用程序获得DPI?
Xfce 支持 HiDPI 缩放,可以使用设置管理器启用:
1.转到设置管理器 >外观>设置>窗口缩放并选择 2 作为缩放因子。
我想知道如果我们将“Window Scaling”调整为“2X”,此时DPI的值是多少?以及如何使用程序(C/C++)获取DPI值?
Xfce supports HiDPI scaling which can be enabled using the settings manager:
1.Go to Settings Manager > Appearance > Settings > Window Scaling and select 2 as the scaling factor.
I wonder to know if we adjust 'Window Scaling' is '2X', at this point, what is the value of DPI ? And how get the DPI value using program(C/C++)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
缩放和DPI可能很棘手,如果可能的话,只需将其留给GTK即可处理它们。如果您可以解释为什么需要他们的价值观,那就太好了。
这是一种查询它们的一种方法的示例:
或者,可以使用
XFConf_Channel_get_int
查询两个值,请参阅XFCE4-SETTING “ nofollow noreferrer”>代码作为参考。Scaling and DPI can be tricky, if possible just leave it to Gtk to handle them. It would be nice if you could explain why do you need their values.
Here is a sample of one way to query them:
Alternatively, both values can be queried using
xfconf_channel_get_int
, see xfce4-settings code as reference.