Hi, I'm in an intro to computer science class and am struggling to figure out how to select a series of pixels from an image that has thousands of pixels, and subsequently change their color. I am using a while loop, and am assigning the variable to the increment. I think I'm doing a few things wrong. So far my failed attempt look like this-
public void changeColor()
{
{
int getPixel=1000;
while ( getPixel<=1110)
{
Pixel myPix=getPixel(1000);
myPix.setColor(0, 0, 0);
}
getPixel=getPixel++;
}
}
Would any kind soul mind offering me a few hints or how to select big groups of pixels using while loops? I think I'm creating an infinite loop on accident, or incrementing the wrong variable. I've had success in previous project but this one is stumping me because there are hundreds of thousands of pixels. I know I can't create variable for them all, so I need to group them with loops. I'm pretty new at this. Any help or guidance to understand the mistakes or big picture would be greatly appreciated.
Thanks so much and best wishes,
John

