Wysłane przez lukasz w
- Wielkość pliku: 4,5MB
import java.awt.Color; import java.awt.image.*; public class f01 { public BufferedImage draw() { int WIDTH = 3200; int HEIGHT = 3200; int IMG_TYPE = java.awt.image.BufferedImage.TYPE_INT_ARGB; BufferedImage image = new BufferedImage(WIDTH, HEIGHT, IMG_TYPE); ColorModel model = image.getColorModel(); WritableRaster raster = image.getRaster(); Color fcolor; for(int i = 0; i < WIDTH; i++) for(int j = 0; j < HEIGHT; j++) { int z = (((i+1)*512)/((j+1)))|((i*j*8)&0xff)|(i+j)|((i-j)+0xfff); fcolor = new Color(z); raster.setDataElements(i, j, model.getDataElements(fcolor.getRGB(), null)); } return image; } }