Set parameters via command line parameters
This commit is contained in:
@@ -53,11 +53,14 @@ class Main
|
||||
return pixelArray;
|
||||
}
|
||||
|
||||
//Syntax blabla.jar x y Hostname Port Image.png
|
||||
public static void main(String[] args) {
|
||||
final int PORT = 1234;
|
||||
final String HOSTNAME = "localhost";
|
||||
final int xOffset = 0;
|
||||
final int yOffset = 0;
|
||||
final int PORT = Integer.parseInt(args[3]);;
|
||||
final String HOSTNAME = args[2];
|
||||
final int xOffset = Integer.parseInt(args[0]);
|
||||
final int yOffset = Integer.parseInt(args[1]);
|
||||
final String imageName = args[4];
|
||||
|
||||
InetAddress serverAddress = null;
|
||||
try {
|
||||
serverAddress = InetAddress.getByName(HOSTNAME);
|
||||
@@ -66,7 +69,7 @@ class Main
|
||||
}
|
||||
|
||||
// Read the PNG file
|
||||
BufferedImage image = processImage("girl.png");
|
||||
BufferedImage image = processImage(imageName);
|
||||
ArrayList<String> pixelArray = prepareArray(image, xOffset, yOffset);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user