Media Computation Questions
description
Transcript of Media Computation Questions
Media Computation Questions
Barb EricsonGeorgia Tech
Day 2 Questions• How to set the classpath to use Converter in Eclipse?
– I want to try making a jar and using that• How do you save the pictures you have changed?
– use the write method Picture p = new Picture(FileChooser.getMediaPath("barbara.jpg");p.explore();p.decreaseRed();p.explore();p.write(FileChooser.getMediaPath("decRedBarb.jpg"));
• Why is this better than just using Photoshop?– If you just learn photoshop you are limited by what it can do
• If you learn to program you are not limited by your application
Precision Drawings
• How would you draw a stack of filled rectangles starting from the lightest one at the bottom right and the darkest one at the top left.– With 10 pixels between
each– Not easy with drawing
packages
Draw Filled Rectangles Methodpublic void drawFilledRectangles(){ Graphics g = this.getGraphics(); Color color = null; // loop 25 times for (int i = 25; i > 0; i--) { color = new Color(i * 10, i * 5, i); g.setColor(color); g.fillRect(0,0,i*10,i*10); }}
HW2: Create a collage, but must use turtles