由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - How would clear a BufferedImage?
相关主题
an Array question用java画直线的问题
Re: DCOM, CORBA, JAVA/RMI请问Java如何实现对.jpg图片的缩放显示?
请教BufferedImage中的setColor问题。怎么编辑和保存JAVA的图片输出?
help! BufferedImage读写gif图片,不用第三方包
java image processing problemgetImage有个问题
怎么能够减少image上的锯齿?Concurrent Exception in Swing
Java可行性一问:画图然后保存为图像?强制Swing绘制Panel的一个问题
有关BufferedImage width/height 的问题[转载] Re: java thread problem
相关话题的讨论汇总
话题: would话题: clear话题: gc话题: image
进入Java版参与讨论
1 (共1页)
g*****g
发帖数: 34805
1
If I want to reset a BufferedImage to a transparent empty image,
(so that I can change the content of image to paint)
I am doing a new BufferedImage(BufferedImage.INT_ARGB) now,
anyway I can fill the raster instead?
I am worried if this frequent memory allocation would be a big
burden for GC and degrade performance.
m******t
发帖数: 2416
2

Isn't this faster than actually painting it anyway?
I wouldn't worry about it. Speaking of object allocation and GC,
there is an ongoing thread on TSS that might be some good read:
http://www.theserverside.com/news/thread.tss?thread_id=36832

【在 g*****g 的大作中提到】
: If I want to reset a BufferedImage to a transparent empty image,
: (so that I can change the content of image to paint)
: I am doing a new BufferedImage(BufferedImage.INT_ARGB) now,
: anyway I can fill the raster instead?
: I am worried if this frequent memory allocation would be a big
: burden for GC and degrade performance.

c*****t
发帖数: 1879
3
in addition to what magicfat said, you can do direct DataBufferInt
manipulation to set all values to zeros. Of course, new a BufferedImage
is faster in every way you look at :P

【在 g*****g 的大作中提到】
: If I want to reset a BufferedImage to a transparent empty image,
: (so that I can change the content of image to paint)
: I am doing a new BufferedImage(BufferedImage.INT_ARGB) now,
: anyway I can fill the raster instead?
: I am worried if this frequent memory allocation would be a big
: burden for GC and degrade performance.

1 (共1页)
进入Java版参与讨论
相关主题
[转载] Re: java thread problemjava image processing problem
Question on JSP EL怎么能够减少image上的锯齿?
[合集] Web Service Java 客户端的问题Java可行性一问:画图然后保存为图像?
[合集] How to check whether a file is locked?有关BufferedImage width/height 的问题
an Array question用java画直线的问题
Re: DCOM, CORBA, JAVA/RMI请问Java如何实现对.jpg图片的缩放显示?
请教BufferedImage中的setColor问题。怎么编辑和保存JAVA的图片输出?
help! BufferedImage读写gif图片,不用第三方包
相关话题的讨论汇总
话题: would话题: clear话题: gc话题: image