本文介绍了StageStyle.TRANSPARENT的性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当时想通过投影来美化未经修饰的JavaFX阶段.我知道如何使用StageStyle.TRANSPARENT做到这一点,但是我注意到,一旦将此标志传递给舞台,我的应用程序的性能就会下降大约10倍.

I was thinking of glorifying my undecorated JavaFX stage with a drop shadow. I know how to do this with StageStyle.TRANSPARENT, but I noticed that as soon as I pass this flag to the Stage, the performance of my app drops approximately by 10x.

任何人都知道可能导致这种巨大性能下降的原因是什么?还有其他方法可以将阴影添加到未装饰的舞台吗?也许分两个阶段进行破解会带来更好的性能?

Anyone have ideas what might cause this enormous performance drop? Is there any other way to add a drop shadow to an undecorated Stage? Perhaps hacking away with two stages would yield better performance?

好的,我正在分两个阶段进行尝试..现在,性能问题已完全消失,在复杂的主要阶段后面有一个虚拟的影子阶段".

OK, I'm trying this with two stages.. the performance problems are completely gone now, with a dummy "shadow stage" behind the complex main stage.

我现在只有两个问题:1.如何使阴影阶段不出现在任务栏中? 2.如何使Shadow Stage鼠标透明?

I have just two questions now, 1. How can I make the shadow stage not appear in the taskbar? 2. How can I make the shadow stage mouse transparent?

同样,不幸的是,如果没有JNI,我要实现的目标将是不可能的.遗憾的是,透明的舞台出于某种原因而吞噬了所有表演.

Appararently, and unfortunately, what I'm trying to achieve isn't possible without JNI. What a pity that a transparent Stage eats all performance for some reason.

推荐答案

当前无法使用标准JavaFX工具包通过StageStyle.TRANSPARENT来提高舞台的性能.

There is currently no way to improve the performance of stages with StageStyle.TRANSPARENT using the standard JavaFX toolkit.

请参阅相关的问题跟踪参考:

See related issue tracker reference:

该问题目前尚无计划实施,尽管我认为可以考虑将其包含在一些不确定的未来版本中.

The issue is currently not planned for implementation, though I guess it could be considered for inclusion in some undetermined future release.

有趣的是,对于我创建的小部件项目而言,性能一直很好,但我从未注意到有问题,但是我想某些应用程序存在问题,否则JavaFX问题跟踪器中不会存在未解决的问题

Anecdotally, the performance has been fine for little widget projects I have created and I have never noticed an issue, but I guess there is an issue there with some applications otherwise there wouldn't be an open issue in the JavaFX issue tracker around it.

这篇关于StageStyle.TRANSPARENT的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 01:07