Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] colorarray = new int[(ScreenWidth*ScreenHeight)];
- for(int x = 0;x<ScreenWidth;x+=PixelSize)
- {
- for(int y = 0;y<ScreenHeight;y+=PixelSize)
- {
- Point pixelpoint = new Point(x,y); // The point this pixel is at
- Color pixelcolor;
- pixelcolor = pixelbase.get(pixelpoint); // Get the default color for this object
- colorarray[ScreenWidth*y+x]=pixelcolor.getRGB();
- }
- }
- for(int x = 0;x<ScreenWidth;x+=PixelSize)
- {
- for(int y = 0;y<ScreenHeight;y+=PixelSize)
- {
- canvas.setRGB(x,y,PixelSize,PixelSize,colorarray,0,0);
- }
- }
- g.drawImage(canvas,0,0,ScreenWidth,ScreenHeight,null);
Advertisement
Add Comment
Please, Sign In to add comment