Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Write code to set the pixel at (0, 0) to blue (i.e. blue value is 255, red and green are left at 0)
- image = new SimpleImage("x.png");
- image.setZoom(20);
- pixel = image.getPixel(0, 0);
- pixel.setBlue(255);
- print(image);
- --------------------------------------------------------------------------------------------------
- Write code to set the pixel at (0, 0) to be violet (i.e. red and blue both 255, green left at 0).
- image = new SimpleImage("x.png");
- image.setZoom(20);
- pixel = image.getPixel(0, 0);
- pixel.setRed(255);
- pixel.setBlue(255);
- print(image);
- --------------------------------------------------------------------------------------------------
- Write code to set the pixel at (1, 0) to be red
- image = new SimpleImage("x.png");
- image.setZoom(20);
- pixel = image.getPixel(1, 0);
- pixel.setRed(255);
- print(image);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement