x 및 y 카운터 변수를 사용하여 이미지의 왼쪽 하단 모서리의 오른쪽 하단 모서리에서 픽셀을 읽는 프로그램을 만들고 싶습니다. 프로그램은 왼쪽 하단에 오른쪽 하단 픽셀을 할당하고 이미지를 뒤집을 모든 픽셀을이 방식으로 할당합니다. 지금까지중첩 된 for 루프를 사용하여 이미지를 뒤집을 수 있습니까?
내 주요 코드 :
Scanner reader = new Scanner(System.in);
APImage image = new APImage("MrB.JPG");
image.draw();
int width = image.getWidth();
int height = image.getHeight();
APImage brandnew = new APImage(width, height);
int y = 0;
for(y < height; y--;)
{
int x = width - 1
for(x >= 0; x++;)
{
Pixel opixel = image.getPixel(x, y);
}
}
System.out.println("Press the return key to continue");
reader.nextLine();
brandnew.draw();
어떤 도움이 환호를 이해할 수있을 것이다.
하지 않는 한,이 제대로 구현하면 당신도하고 싶은 일을하지 않습니다. –