图像操作时:sun.awt.image.ToolkitImage cannot be cast to java.awt.image.BufferedImage解决思路
图像操作时:sun.awt.image.ToolkitImage cannot be cast to java.awt.image.BufferedImage解决思路
日期:2014-05-20 浏览次数:20889 次
图像操作时:sun.awt.image.ToolkitImage cannot be cast to java.awt.image.BufferedImage 图像操作时:想要将一个JFrame的Panel中createImage产生的Image图像转化为BufferedImage图像, 使用ImageProducer ip=new MemoryImageSource(iw,ih,pixels,0,iw); tmp=createImage(ip); BufferedImage im=(BufferedImage)tmp; 方法强制转换时产生错误 提示:sun.awt.image.ToolkitImage cannot be cast to java.awt.image.BufferedImage