tyridge77

Untitled

Feb 19th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1.  
  2. int[] colorarray = new int[(ScreenWidth*ScreenHeight)];
  3.  
  4.  
  5. for(int x = 0;x<ScreenWidth;x+=PixelSize)
  6. {
  7. for(int y = 0;y<ScreenHeight;y+=PixelSize)
  8. {
  9.  
  10. Point pixelpoint = new Point(x,y); // The point this pixel is at
  11. Color pixelcolor;
  12.  
  13. pixelcolor = pixelbase.get(pixelpoint); // Get the default color for this object
  14.  
  15.  
  16.  
  17. colorarray[ScreenWidth*y+x]=pixelcolor.getRGB();
  18.  
  19.  
  20.  
  21. }
  22.  
  23.  
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. for(int x = 0;x<ScreenWidth;x+=PixelSize)
  37. {
  38. for(int y = 0;y<ScreenHeight;y+=PixelSize)
  39. {
  40. canvas.setRGB(x,y,PixelSize,PixelSize,colorarray,0,0);
  41. }
  42. }
  43.  
  44. g.drawImage(canvas,0,0,ScreenWidth,ScreenHeight,null);
Advertisement
Add Comment
Please, Sign In to add comment