picture lab. manipulating pictures discussion and activities with java.awt.color introduce students...
TRANSCRIPT
Manipulating Pictures
• Discussion and activities with java.awt.Color introduce students to megapixels, pixels, the RGB color model, binary numbers, bit, and byte.
• Processing individual pixels involves 2D array concepts: row-major order, column-major order, array of arrays, and nested loops.
• And more…
Picking a color
• Students practice making different colors using combinations of red, green, and blue light using a JColorChooser.
• 20 minutes – 1 hour
Two-dimensional arrays in Java (Optional activity)
• Students write methods for 2D array of integers. – Declare 2D array– Create 2D array– Get or set elements– Get number of rows/columns
0 1 2 0 1 2 3
1 4 5 6
– Traverse in row-major and column-major order• 30 minutes – 1 hour
Creating a collage
• Overload copy method • Modifying • Mirror the resulting collage. • 1 – 3 hours
Collage with vertical mirror