当前位置: 技术问答>java相关
高手行行好,帮我看看
来源: 互联网 发布时间:2015-01-29
本文导语: This method returns immediately in all cases, even if the entire image has not yet been scaled, dithered, and converted for the current output device. If the current output representation is not yet complete, then drawImage returns false. As more...
This method returns immediately in all cases, even if the entire image has not yet been scaled, dithered, and converted for the current output device. If the current output representation is not yet complete, then drawImage returns false. As more of the image becomes available, the process that draws the image notifies the image observer by calling its imageUpdate method.
看不懂这里,我的drawImage方法返回来一个false,图片没出来,怎么办
看不懂这里,我的drawImage方法返回来一个false,图片没出来,怎么办
|
用Component.prepareImage,然后再 g.drawImage
public boolean prepareImage( Image image, ImageObserver observer )
Parameters
image
the Image for which to prepare a screen representation.
observer
the ImageObserver object to be notified as the image is being prepared.
Returns
true if the image has already been fully prepared; false otherwise.
Description
Prepares an image for rendering on this component. The image data is downloaded asynchronously in another thread and the appropriate screen representation of the image is generated.
public boolean prepareImage( Image image, ImageObserver observer )
Parameters
image
the Image for which to prepare a screen representation.
observer
the ImageObserver object to be notified as the image is being prepared.
Returns
true if the image has already been fully prepared; false otherwise.
Description
Prepares an image for rendering on this component. The image data is downloaded asynchronously in another thread and the appropriate screen representation of the image is generated.