Java小程序中的drawImage在Safari中闪烁
我在 Safari (Mac) 中的 Java 小程序中遇到闪烁问题。 然而,这不是通常的双缓冲问题。
我将其隔离为一个 drawImage
调用(没有多余的重绘,没有调用 clear
),这会在绘制图像之前产生白色闪烁,但不会在每次重绘时产生白色闪烁。 事实上,我测量了drawImage
调用的持续时间,通常约为1ms,但大约每5次调用paint时最多可达30ms,也就是它闪烁的时候。 当我拖动组件或滚动窗口时会触发重绘。
这是 OSX 上 java 实现中的一个错误吗?有修复方法吗?
I'm having a flicker problem in a Java applet in Safari (Mac). However, it's not the usual double buffering problem.
I have isolated it down to one single drawImage
call (no redundant repaint, no clear
is called), which gives a white flicker before painting the image but not on every repaint. In fact, I measured the duration of the drawImage
call, which is normally about 1ms, but up to 30ms about every 5th time paint is called, which is when it flickers. Repaints are triggered when I drag a component or when the window is scrolled.
Is this a bug in the java implementation on OSX, and is there a fix for it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您提供的信息非常少。 这很难回答。
您在绘制图像之前会重新创建图像吗? 然后您可以缓冲它或使用媒体跟踪器。
如果您使用旧的 Java 版本,请更新它。 OSX 的旧版本有很多错误。
You give very small information. That is difficult to answer.
Do you recreate the Image before you paint it? Then you can buffer it or use an media tracker.
If you use an old Java version then update it. The old versions for OSX are very buggy.
我假设您的问题是通用的闪烁小程序问题。
解决方案就在那里: BackBuffer
我希望它有所帮助。
I'll assume that your problem is the generic flickering applet problem.
the solution is there: BackBuffer
i hope it helps.