简体   繁体   English

JavaFX:如何检查抗锯齿支持

[英]JavaFX: how to check for anti-aliasing support

When creating a JavaFX Scene, I am passing in SceneAntialiasing.BALANCED as a parameter, but on my laptop it gives me this warning: 创建JavaFX场景时,我将SceneAntialiasing.BALANCED作为参数传递,但是在我的笔记本电脑上,它给了我以下警告:

WARNING: System can't support antiAliasing

I'd like to know if there is any way of testing for this ability programmatically? 我想知道是否可以通过编程方式测试此功能? There seems to be nothing under the javafx.application.ConditionalFeature checks that you can do on the Platform object. 在javafx.application.ConditionalFeature检查下,您似乎无法对Platform对象执行任何操作。 Anyone have any pointers on this? 有人对此有任何指示吗?

Best you can do is just check: 最好的办法就是检查:

Platform.isSupported(ConditionalFeature.SCENE3D)

There is no explicit feature check for scene anti-aliasing. 没有针对场景抗锯齿的显式功能检查。 The scene anti-aliasing documentation refers to the SCENE3D conditional feature . 场景抗锯齿文档引用了SCENE3D条件功能 I guess that it is possible for SCENE3D to be supported while scene anti-aliasing is not (though I would think that would be quite a rare combination). 我猜有可能在不支持场景抗锯齿的情况下支持SCENE3D (尽管我认为那是非常罕见的组合)。 I think that if SCENE3D is supported but scene anti-aliasing is not, it would seem that most applications would want to display the 3D scene anyway, just without anti-aliasing, which I think is how JavaFX would handle this. 我认为,如果支持SCENE3D但不支持场景抗锯齿,则似乎大多数应用程序无论如何都希望显示3D场景,而没有抗锯齿,这就是JavaFX如何处理的。 The potential warning output to the command line is slightly annoying, but probably not a deal breaker for most apps. 潜在的警告输出到命令行有点烦人,但对于大多数应用程序来说可能不是一个破坏交易的因素。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM