Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 15th, 2010 | Syntax: None | Size: 0.79 KB | Hits: 42 | Expires: Never
Copy text to clipboard
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. package punkbuster.scraper.pattern;
  7.  
  8. import java.awt.Robot;
  9.  
  10. /**
  11.  *
  12.  * @author Andreas Böck
  13.  */
  14. public class RectangleScraper {
  15.     private Rectangle colorRect;
  16.     private int width;
  17.     private int height;
  18.  
  19.     public RectangleScraper(int windowx, int windowy, int width, int height, Robot robo){
  20.         this.width = width;
  21.         this.height = height;
  22.         colorRect = new Rectangle(width,height);
  23.  
  24.         for (int x=0;x<width;x++){
  25.             for (int y=0;y<height;y++){
  26.                 colorRect.setPixel(x, y , robo.getPixelColor(windowx+x, windowy+y));
  27.             }
  28.         }
  29.     }
  30.  
  31.     public Rectangle getColorRect() {
  32.         return colorRect;
  33.     }
  34.  
  35. }