Agenda Warmup Prep for Core #1 Lesson G2 (RGB, Loops in Graphics)

Slides:



Advertisements
Similar presentations
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
Advertisements

Laboratory Study II October, Java Programming Assignment  Write a program to calculate and output the distance traveled by a car on a tank of.
PHY-102 SAPIntroductory GraphicsSlide 1 Introductory Graphics In this section we will learn how about how to draw graphics on the screen in Java:  Drawing.
LAB SESSION 7 Graphical user interface Applet fundamentals Methods in applets Execution of an applet Graphics class.
Applets Graphical Java programs Run inside web browser Platform-neutral Easy deployment--loads when needed Secure.
Introduction to compositing. What is compositing?  The combination of two images to produce a single image  Many ways we can do this, especially in.
© 2004 Pearson Addison-Wesley. All rights reserved2-1 Introduction to Graphics The last few sections of each chapter of the textbook focus on graphics.
Image Maps and Graphics Internet Basics and Far Beyond! Mrs. Wilson.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
COMP 14: Files and Graphics for Applets June 19, 2000 Nick Vallidis.
1 L44 Introduction to Java Applets. 2 OBJECTIVES  To differentiate between applets and applications.  To observe some of Java's exciting capabilities.
A Simple Applet.
Chapter 5 Graphics. Topics Applets Classes used for graphics –Graphics –Point –Dimension –Color.
Program Design With Methods And Graphics / Chapter 4 1 Abstract Window Toolkit.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
Web Design Vocab 12 The Last one! Applet, HTTPS, RGB Color, Rollover, Server.
Agenda For Feb Finish up Unit 3 Exercises on page Unit 4 Exercises on page 33. Question #2 3. Create a Happy Face Java Applet (due next class).
Image Processing & Perception Sec 9-11 Web Design.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 14 Java Fundamentals 2D Graphics Wed. 10/11/00.
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
Chapter 2: Color and Applets Coming up: Introduction to Graphics.
Graphics & Applets CSC 1051 – Data Structures and Algorithms I
Loops & Graphics IP 10 Mr. Mellesmoen Recall Earlier we wrote a program listing numbers from 1 – 24 i=1 start: TextWindow.WriteLine(i) i=i+1 If.
Attributes of drawing elements
GRAPHICS MODULE 14 STUDY BOOK. Graphic commands SCREEN - puts the screen into graphics mode WINDOW - allows scaling of the screen LINE - 3 formats –LINE.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
1 A Simple Applet. 2 Applets and applications An applet is a Java program that runs on a web page Applets can be run within any modern browser To run.
1 Introduction to Graphics b The last one or two sections of each chapter of the textbook focus on graphical issues b Most computer programs have graphical.
PART TWO Electronic Color & RGB values 1. Electronic Color Computer Monitors: Use light in 3 colors to create images on the screen Monitors use RED, GREEN,
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
Please open JCreator and follow these steps: 1)Configure  Options 2)JDK Tools 3)Choose Run Applet from drop-down 4)Click Default, then Edit 5)Click the.
An urn contains 1 green, 2 red, and 3 blue marbles. Draw two without replacement. 1/6 2/6 3/6 2/5 3/5 1/5 3/5 1/5 2/5 2/30 3/30 2/30 6/30 3/30 6/30.
Basic Graphics 03/03/16 & 03/07/16 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education - Prentice Hall, 2010.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
10/20/2005week71 Graphics, mouse and mouse motion events, KeyEvent Agenda Classes in AWT for graphics Example java programs –Graphics –Mouse events –Mouse.
1,2,3,4,5,6…..... Fun and Games What am I Learning Today? Prime and Composite Numbers.
Intro to Graphics from Chapter 2 of Java Software Solutions
Agenda Warmup Lesson 1.4 (double precision, String methods, etc)
The Box Model in CSS Web Design – Sec 4-8
Sorting and Grouping.
Building Java Programs
CSC 1051 – Data Structures and Algorithms I
Image Processing & Perception
Agenda Warmup Finish 2.4 Assignments
Introduction to Java Applets
Agenda Warmup AP Exam Review: Litvin A2
Graphics Fundamentals
Graphical Output Graphical Text.
Building Java Programs
Building Java Programs
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Agenda Warmup Lesson 2.5 (Ascii, Method Overloading)
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Basic Graphics Drawing Shapes 1.
CS320n –Visual Programming
Computer Graphics.
SSEA Computer Science: Track A
Assign Courses New – Group administrators can now assign courses to their staff NEW FEATURE: Training Coordinators can now assign courses to their staff.
Here are four triangles. What do all of these triangles have in common
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Introduction to Fractions
Agenda Warmup Lesson 1.6 (Do-while loops, sentinels, etc)
Agenda Warmup Lesson 2.2 (parameters, etc)
Agenda Warmup Lesson 1.6 (Do-while loops, sentinels, etc)
Agenda Warmup Review Finish 1.2 Assignments Lesson 1.3 (If Statements)
Agenda Warmup Lesson 2.8 (Overloading constructors, etc)
Translate 5 squares left and 4 squares up.
Agenda Warmup Review Finish 1.2 Assignments Lesson 1.3 (If Statements)
Presentation transcript:

Agenda Warmup Prep for Core #1 Lesson G2 (RGB, Loops in Graphics) Independent Practice (G2 Assignments) Time Permitting: Lesson G3 (Applet Methods) Closure Activity Students will be able to: Understand how RGB colors work in Java Create a custom color using RGB values Use a loop to create multiple drawings in an applet Create multiple objects, then call their draw( ) methods See how today's lesson fits into the unit and the course as a whole

Warmup What is a nested loop? What is an accumulator? What is an applet? What must you do with an applet in order to display it? Which important data are specified in an HTML document in JCreator? If a window in appletviewer is 400 x 600, what are the coordinates of the upper-right corner? What code would draw a square whose upper-left corner is at the upper-left corner of the appletviewer window, and whose area is 256 square pixels? In an ArrayList called x, what code would replace the 2nd element with an Object called y?

RGB use RGB (red, green, blue) to create a color other than one of the pre-defined colors. For each of the 3 colors, you must enter a number between 0 and 255. For example, pure red would have a red value of 255, and green and blue would have values of 0. EXAMPLE: page.setColor(new Color(5,240,100)); page.fillOval(4,4,90,90); // creates a circle that is mostly green, with // some blue and very little red. See RGBDemo

Using loops in graphics For simple drawings, if you want to draw more than one, it is often most efficient to do so in a loop. Demo: Bullseye

Assignments (show examples) P. 186 # 17 (use a loop, and page.drawLine) 2. P. 186 # 18 (use RGB values and a loop)