我的重点是把 Java项目运往一个安乐团项目,最近遇到了以下法典:
//data is an integer array of pixel colour information
//cm is an instance of IndexColorModel class
//bi is an instance of BufferedImage class
//x, y, cx, cy, offset, w, minX, minY are just known integers
//surface is an instance of a class extending Canvas class
for (int i = 0; i < data.length; i++)
data[i] = cm.getRGB(data[i]);
bi.setRGB(x, y, cx, cy, data, offset, w);
surface.repaint(minX, minY, maxX - minX + 1, maxY - minY + 1);
谁能提供上述 Java绘画的同仁? 守则、评论和内容都受到欢迎。
Another question is, how could we know whether a component (for example, a Canvas object) is lightweight or heavyweight component?
确实受到赞赏!