Skip to content

Instantly share code, notes, and snippets.

@EFox2413
Created July 21, 2013 21:30
Show Gist options
  • Save EFox2413/6050065 to your computer and use it in GitHub Desktop.
Save EFox2413/6050065 to your computer and use it in GitHub Desktop.
package hackThisSite2;
import java.io.*;
import java.awt.image.*;
class Mission2 {
public static void main(String[] args) {
BufferedImage img = null;
try {
img = javax.imageio.ImageIO.read(new File("C:\\Users\\Fox\\Downloads\\mission2.png"));
} catch (IOException e) {
}
int minx = img.getMinX();
int miny = img.getMinY();
int maxx = img.getTileWidth();
System.out.println("The maximum number of tiles in the x dir is: " + maxx);
for(int x = minx; x != maxx; x++) {
System.out.println("pixel at " + x + ", " + miny + " is: " + img.getRGB(x, miny));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment