This method below currently sets the color of all of the pixels in the given Picture to
Fantastic news! We've Found the answer you've been seeking!
Question:
This method below currently sets the color of all of the pixels in the given Picture to black. It needs to only sets the pixels on the left half of the image to black. In other words, all pixels with an x coordinate less than half the width should be set to black. What should be changed in the for loops below so that the method does what is needed
public void setLeftHalfOfPicture(Picture pic)
{
for (int x = 0; x < pic.getWidth(); x++)
{
for (int y = 0; y < pic.getHeight(); y++)
{
pic.getPixel(x, y).setColor(Color.BLACK);
}
}
}
Related Book For
International Marketing And Export Management
ISBN: 9781292016924
8th Edition
Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr
Posted Date: