Java applet中的drawImage在Safari中闪烁
I'm having a flicker problem in a Java applet in Safari (Mac). However, it's not the usual double buffering problem.
我在Safari(Mac)的Java小程序中遇到闪烁问题。但是,这不是通常的双缓冲问题。
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.
我将它分离为一个单独的drawImage调用(没有冗余重绘,没有调用clear),在绘制图像之前会产生白色闪烁,但不会在每次重绘时产生。实际上,我测量了drawImage调用的持续时间,通常大约是1ms,但是大约每隔5次调用一次,最多30ms,这就是它闪烁的时间。拖动组件或滚动窗口时会触发重绘。
Is this a bug in the java implementation on OSX, and is there a fix for it?
这是OSX上java实现中的一个错误,是否有修复方法?
2 个解决方案
#1
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.
如果您使用旧的Java版本,则更新它。 OSX的旧版本非常多。
更多相关文章
- 字体图标的引入和通过媒体查询改变导航样式
- HTML样式和常用选择器
- 字体图标的引用和自定义样式/媒体查询的使用
- 数据库的CURD操作、PDO本质与原理的学习
- CSS之伪类选择器和简单盒子简单案例
- 伪类选择器与盒模型常用属性
- 伪类选择器-结构伪类、根据位置选择匹配
- 7.4——常用标签与应用场景之表格与单元格
- css伪类选择器和盒模型