CSE 8A Chapter Notes - Chapter 5.2: Infinite Loop

24 views3 pages

Document Summary

In order to copy one picture to another, we need a source picture to take pixels from, and a target picture to copy pixels into. Instead of actually moving the pixel, we make the same pixel in both pictures the same color. You can have multiple initialization variables, tests, and increments in a for loop, just as how it was done above. The target picture (the one we want to copy pixels into) is the caller object for this method -> it"s why we see targetpixel = this. getpixel(targetx, targety); We then set this target pixel to the same color as the source pixel. Specifying where to start and stop in this for loop will copy a part of the picture only -> this is known as cropping. Method overloading methods can have the same name as long as they have different parameter lists public void dosomething (int numtimes) { public void dosomething (double numtimes) {

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents