Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Midterm exam 1 review Sp2006: What do they do?

Questions, comments, concerns, answers, concerns about answers?
(Back to Midterm Exam 1 Review Sp2006)


Method A:
Creates a negative or inverse image of the entire picture.
Method B:
Creates a negative image of half of the picture, starting from the middle and going to the right edge.
Example, if O rerpresents pixels left as their original color and N is pixels that are negated:
OOONNN
OOONNN
OOONNN
Method C:
The top half of the image is negated, starting from y=0 (that's the top) and moving down towards the middle.

I think those are right...

Uploaded Image: swanMA.jpegYouUploaded Image: swanMB.jpegGotUploaded Image: swanMC.jpegIt (nj Jim)
Here are the pictures that come out when you run class Picture methodA(), methodB(), and methodC()
Michael Campbell


That's what I was thinking! I concur. :)
Student252

I'm sorry if this sounds kind of slow, but when int x=0, does it start from a pixel in the top corner or the bottom corner of the picture?

It's starts counting in the bottom corner I believe, just like a graph would.

Sorry, but I think you're wrong, person who posted before me. Java looks at pixels from top to bottom, so the first point of (0,0) would be the top left hand corner. The x-values increase towards the right, and the y-values increase going down. From a graphing perspective, its like using the the (x, -y) plot, except y isn't negative.

Correct, person above me. Remember cartesian graph quadrants?
Q2 | Q1
Q3 | Q4
It's like you're drawing in the 4th quadrant, if that helps...
~Jim

Yup, upper left hand corner is (0,0). X's increase from left to right, and Y's increase from top to bottom. Mark Guzdial




Link to this Page