Appendix F: Java Graphics
|
|
- Egbert Dickerson
- 5 years ago
- Views:
Transcription
1 Appendix F: Java Graphics CS 121 Department of Computer Science College of Engineering Boise State University August 21, 2017 Appendix F: Java Graphics CS / 1
2 Topics Graphics and Images Coordinate System Representing Color Drawing Shapes Scalable Drawings Simple Animation Appendix F: Java Graphics CS / 1
3 Graphics A picture or drawing must be digitized for storage on a computer. A picture is made up of pixels (picture elements), and each pixel is stored separately. Appendix F: Java Graphics CS / 1
4 Graphics A picture or drawing must be digitized for storage on a computer. A picture is made up of pixels (picture elements), and each pixel is stored separately. The picture resolution is the number of pixels used to represent a picture. The number of pixels that can be displayed on a screen is called the screen resolution Appendix F: Java Graphics CS / 1
5 Images A medium resolution image (original image was pixels). Appendix F: Java Graphics CS / 1
6 Images A medium resolution image (original image was pixels). The same image zoomed in to show pixels. Appendix F: Java Graphics CS / 1
7 Graphics Coordinate System Each pixel is identified using a two-dimensional coordinate system. Appendix F: Java Graphics CS / 1
8 Graphics Coordinate System Each pixel is identified using a two-dimensional coordinate system. In graphics, the origin is at the top left corner with x coordinate increasing to the right and y coordinate increasing going down. Appendix F: Java Graphics CS / 1
9 Representing Color A black and white picture can be represented with 1 bit per pixel (0 = white, 1 = black). A grayscale picture can be represented with 8 bits per pixel (0-255). Appendix F: Java Graphics CS / 1
10 Representing Color A black and white picture can be represented with 1 bit per pixel (0 = white, 1 = black). A grayscale picture can be represented with 8 bits per pixel (0-255). A colored picture can be represented as a mixture of primary colors Red, Green, and Blue. Each color is represented by three numbers between 0 and 255 that collectively are called an RGB value. Appendix F: Java Graphics CS / 1
11 Representing Color A black and white picture can be represented with 1 bit per pixel (0 = white, 1 = black). A grayscale picture can be represented with 8 bits per pixel (0-255). A colored picture can be represented as a mixture of primary colors Red, Green, and Blue. Each color is represented by three numbers between 0 and 255 that collectively are called an RGB value. How many colors can we represent with the RGB representation? Appendix F: Java Graphics CS / 1
12 Representing Color A black and white picture can be represented with 1 bit per pixel (0 = white, 1 = black). A grayscale picture can be represented with 8 bits per pixel (0-255). A colored picture can be represented as a mixture of primary colors Red, Green, and Blue. Each color is represented by three numbers between 0 and 255 that collectively are called an RGB value. How many colors can we represent with the RGB representation? In Java, color is represented as a Color class (from the java.awt package) Color mycolor = new Color(0, 255, 255); Appendix F: Java Graphics CS / 1
13 Representing Color A black and white picture can be represented with 1 bit per pixel (0 = white, 1 = black). A grayscale picture can be represented with 8 bits per pixel (0-255). A colored picture can be represented as a mixture of primary colors Red, Green, and Blue. Each color is represented by three numbers between 0 and 255 that collectively are called an RGB value. How many colors can we represent with the RGB representation? In Java, color is represented as a Color class (from the java.awt package) Color mycolor = new Color(0, 255, 255); Some predefined colors in the Color class. Color Object RGB value black Color.black 0, 0, 0 white Color.white 255, 255, 255 red Color.red 255, 0, 0 green Color.green 0, 255, 0 blue Color.blue 0, 0, 255 yellow Color.yellow 255, 255, 0 cyan Color.cyan 0, 255, 255 Appendix F: Java Graphics CS / 1
14 Graphics Class (1) We will use the Graphics class from the java.awt package for drawing shapes. Appendix F: Java Graphics CS / 1
15 Graphics Class (1) We will use the Graphics class from the java.awt package for drawing shapes. The Graphics class provides methods for drawing lines, rectangles, ovals, arcs and strings among others. Appendix F: Java Graphics CS / 1
16 Graphics Class (1) We will use the Graphics class from the java.awt package for drawing shapes. The Graphics class provides methods for drawing lines, rectangles, ovals, arcs and strings among others. Shapes drawn by the Graphics class can be unfilled or filled. Appendix F: Java Graphics CS / 1
17 Graphics Class (1) We will use the Graphics class from the java.awt package for drawing shapes. The Graphics class provides methods for drawing lines, rectangles, ovals, arcs and strings among others. Shapes drawn by the Graphics class can be unfilled or filled. The method parameters specify coordinates and sizes. Appendix F: Java Graphics CS / 1
18 Graphics Class (1) We will use the Graphics class from the java.awt package for drawing shapes. The Graphics class provides methods for drawing lines, rectangles, ovals, arcs and strings among others. Shapes drawn by the Graphics class can be unfilled or filled. The method parameters specify coordinates and sizes. Shapes with curves, like an oval, are usually drawn by specifying the shape s bounding rectangle. Appendix F: Java Graphics CS / 1
19 Graphics Class (1) We will use the Graphics class from the java.awt package for drawing shapes. The Graphics class provides methods for drawing lines, rectangles, ovals, arcs and strings among others. Shapes drawn by the Graphics class can be unfilled or filled. The method parameters specify coordinates and sizes. Shapes with curves, like an oval, are usually drawn by specifying the shape s bounding rectangle. An arc is a section of an oval. Appendix F: Java Graphics CS / 1
20 Graphics Class (2) Selected methods from the Graphics class. drawline(int x1, int y1, int x2, int y2) Draws a line between the points (x1, y1) and (x2, y2) Appendix F: Java Graphics CS / 1
21 Graphics Class (2) Selected methods from the Graphics class. drawline(int x1, int y1, int x2, int y2) Draws a line between the points (x1, y1) and (x2, y2) drawrect(int x, int y, int width, int height) fillrect(int x, int y, int width, int height) Draws/fills the specified rectangle. Appendix F: Java Graphics CS / 1
22 Graphics Class (2) Selected methods from the Graphics class. drawline(int x1, int y1, int x2, int y2) Draws a line between the points (x1, y1) and (x2, y2) drawrect(int x, int y, int width, int height) fillrect(int x, int y, int width, int height) Draws/fills the specified rectangle. drawoval(int x, int y, int width, int height) filloval(int x, int y, int width, int height) Draws/fills the oval bounded by the specified rectangle. Appendix F: Java Graphics CS / 1
23 Graphics Class (2) Selected methods from the Graphics class. drawline(int x1, int y1, int x2, int y2) Draws a line between the points (x1, y1) and (x2, y2) drawrect(int x, int y, int width, int height) fillrect(int x, int y, int width, int height) Draws/fills the specified rectangle. drawoval(int x, int y, int width, int height) filloval(int x, int y, int width, int height) Draws/fills the oval bounded by the specified rectangle. drawarc(int x, int y, int width, int height, int startangle, int arcangle) fillarc(int x, int y, int width, int height, int startangle, int arcangle) Draws/fills the arc bounded by the specified rectangle. Appendix F: Java Graphics CS / 1
24 Graphics Class (2) Selected methods from the Graphics class. drawline(int x1, int y1, int x2, int y2) Draws a line between the points (x1, y1) and (x2, y2) drawrect(int x, int y, int width, int height) fillrect(int x, int y, int width, int height) Draws/fills the specified rectangle. drawoval(int x, int y, int width, int height) filloval(int x, int y, int width, int height) Draws/fills the oval bounded by the specified rectangle. drawarc(int x, int y, int width, int height, int startangle, int arcangle) fillarc(int x, int y, int width, int height, int startangle, int arcangle) Draws/fills the arc bounded by the specified rectangle. drawstring(string str, int x, int y)) Draws the text given by the specified string. Appendix F: Java Graphics CS / 1
25 Graphics Class (2) Selected methods from the Graphics class. drawline(int x1, int y1, int x2, int y2) Draws a line between the points (x1, y1) and (x2, y2) drawrect(int x, int y, int width, int height) fillrect(int x, int y, int width, int height) Draws/fills the specified rectangle. drawoval(int x, int y, int width, int height) filloval(int x, int y, int width, int height) Draws/fills the oval bounded by the specified rectangle. drawarc(int x, int y, int width, int height, int startangle, int arcangle) fillarc(int x, int y, int width, int height, int startangle, int arcangle) Draws/fills the arc bounded by the specified rectangle. drawstring(string str, int x, int y)) Draws the text given by the specified string. getcolor() setcolor(color c) Gets/sets the current color. Appendix F: Java Graphics CS / 1
26 Graphics Class (3) The drawrect method: Appendix F: Java Graphics CS / 1
27 Graphics Class (3) The drawrect method: The drawoval method: Appendix F: Java Graphics CS / 1
28 Graphics Class (4) The drawarc method: Appendix F: Java Graphics CS / 1
29 Examples We will use a template that extends the JPanel class from the javax.swing package. Focus only on the paintcomponent method! Appendix F: Java Graphics CS / 1
30 Examples We will use a template that extends the JPanel class from the javax.swing package. Focus only on the paintcomponent method! Examples: BasicShapes.java Appendix F: Java Graphics CS / 1
31 Examples We will use a template that extends the JPanel class from the javax.swing package. Focus only on the paintcomponent method! Examples: BasicShapes.java Shapes.java Appendix F: Java Graphics CS / 1
32 Examples We will use a template that extends the JPanel class from the javax.swing package. Focus only on the paintcomponent method! Examples: BasicShapes.java Shapes.java Snowman.java Appendix F: Java Graphics CS / 1
33 Examples We will use a template that extends the JPanel class from the javax.swing package. Focus only on the paintcomponent method! Examples: BasicShapes.java Shapes.java Snowman.java In-class Exercise: Modify the snowman program as follows: Move the sun to the upper right Appendix F: Java Graphics CS / 1
34 Examples We will use a template that extends the JPanel class from the javax.swing package. Focus only on the paintcomponent method! Examples: BasicShapes.java Shapes.java Snowman.java In-class Exercise: Modify the snowman program as follows: Move the sun to the upper right Display your name in the upper left corner of the picture Appendix F: Java Graphics CS / 1
35 Examples We will use a template that extends the JPanel class from the javax.swing package. Focus only on the paintcomponent method! Examples: BasicShapes.java Shapes.java Snowman.java In-class Exercise: Modify the snowman program as follows: Move the sun to the upper right Display your name in the upper left corner of the picture Make the snowman frown instead of smile Appendix F: Java Graphics CS / 1
36 Examples We will use a template that extends the JPanel class from the javax.swing package. Focus only on the paintcomponent method! Examples: BasicShapes.java Shapes.java Snowman.java In-class Exercise: Modify the snowman program as follows: Move the sun to the upper right Display your name in the upper left corner of the picture Make the snowman frown instead of smile Shift the entire snowman to the left by 20 pixels Appendix F: Java Graphics CS / 1
37 Examples We will use a template that extends the JPanel class from the javax.swing package. Focus only on the paintcomponent method! Examples: BasicShapes.java Shapes.java Snowman.java In-class Exercise: Modify the snowman program as follows: Move the sun to the upper right Display your name in the upper left corner of the picture Make the snowman frown instead of smile Shift the entire snowman to the left by 20 pixels Further Exercise. Scale the Snowman to half the size! Appendix F: Java Graphics CS / 1
38 Graphics Techniques Basic techniques for drawing: Translation Appendix F: Java Graphics CS / 1
39 Graphics Techniques Basic techniques for drawing: Translation (Illustrated in the Snowman example using the MID variable) Appendix F: Java Graphics CS / 1
40 Graphics Techniques Basic techniques for drawing: Translation (Illustrated in the Snowman example using the MID variable) Centering Appendix F: Java Graphics CS / 1
41 Graphics Techniques Basic techniques for drawing: Translation (Illustrated in the Snowman example using the MID variable) Centering Scaling Appendix F: Java Graphics CS / 1
42 Graphics Techniques Basic techniques for drawing: Translation (Illustrated in the Snowman example using the MID variable) Centering Scaling This example illustrates how to make the graphics center and scale automatically if the user resizes the window. DrawPieChart.java DrawPieChartScalable.java Appendix F: Java Graphics CS / 1
43 Graphics Techniques Basic techniques for drawing: Translation (Illustrated in the Snowman example using the MID variable) Centering Scaling This example illustrates how to make the graphics center and scale automatically if the user resizes the window. DrawPieChart.java DrawPieChartScalable.java An example that shows how to use a custom font and center a String using font metrics: CenterText.java Appendix F: Java Graphics CS / 1
44 Graphics Techniques Basic techniques for drawing: Translation (Illustrated in the Snowman example using the MID variable) Centering Scaling This example illustrates how to make the graphics center and scale automatically if the user resizes the window. DrawPieChart.java DrawPieChartScalable.java An example that shows how to use a custom font and center a String using font metrics: CenterText.java Another example that shows how to draw thicker lines: Strokes.java Appendix F: Java Graphics CS / 1
45 Graphics Techniques Basic techniques for drawing: Translation (Illustrated in the Snowman example using the MID variable) Centering Scaling This example illustrates how to make the graphics center and scale automatically if the user resizes the window. DrawPieChart.java DrawPieChartScalable.java An example that shows how to use a custom font and center a String using font metrics: CenterText.java Another example that shows how to draw thicker lines: Strokes.java Another example that shows how to load an image: ImageAvatar.java Appendix F: Java Graphics CS / 1
46 Animation Animation involves drawing the picture multiple times (with incremental variation) per second using a timer to create the illusion of movement. Appendix F: Java Graphics CS / 1
47 Animation Animation involves drawing the picture multiple times (with incremental variation) per second using a timer to create the illusion of movement. The individual pictures are referred to as frames in movies (animated or otherwise) Appendix F: Java Graphics CS / 1
48 Animation Animation involves drawing the picture multiple times (with incremental variation) per second using a timer to create the illusion of movement. The individual pictures are referred to as frames in movies (animated or otherwise) These examples show how we can animate our drawings! SimpleAnimation.java SimpleAnimationScaled.java DigitalClock.java Appendix F: Java Graphics CS / 1
49 Summary How graphics coordinate system works How color is represented How to center, scale and translate drawings How animation works Using Graphics, Color, Font and related classes Appendix F: Java Graphics CS / 1
50 Exercises Read Appendix F (pp ). Recommended Homework: Exercises: EX F.2 F.6. Projects: PP F.4, PP F.15. Appendix F: Java Graphics CS / 1
Appendix F: Java Graphics
Appendix F: Java Graphics CS 121 Department of Computer Science College of Engineering Boise State University August 21, 2017 Appendix F: Java Graphics CS 121 1 / 15 Topics Graphics and Images Coordinate
More informationGraphics Applets. By Mr. Dave Clausen
Graphics Applets By Mr. Dave Clausen Applets A Java application is a stand-alone program with a main method (like the ones we've seen so far) A Java applet is a program that is intended to transported
More informationCSC 1051 Data Structures and Algorithms I. Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University
Graphics & Applets CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/ Back to Chapter
More informationGraphics Applets. By Mr. Dave Clausen
Graphics Applets By Mr. Dave Clausen Applets A Java application is a stand-alone program with a main method (like the ones we've seen so far) A Java applet is a program that is intended to transported
More informationpublic static void main(string[] args) { GTest mywindow = new GTest(); // Title This program creates the following window and makes it visible:
Basics of Drawing Lines, Shapes, Reading Images To draw some simple graphics, we first need to create a window. The easiest way to do this in the current version of Java is to create a JFrame object which
More informationHTML Links Tutorials http://www.htmlcodetutorial.com/ http://www.w3.org/markup/guide/ Quick Reference http://werbach.com/barebones/barebones.html Applets A Java application is a stand-alone program with
More informationApplets and the Graphics class
Applets and the Graphics class CSC 2014 Java Bootcamp Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Some slides in this presentation are adapted from the slides accompanying
More informationLecture 7 A First Graphic Program And Data Structures & Drawing
Lecture 7 A First Graphic Program And Data Structures & Drawing Objective The objective is that you will understand: How to program the generation of 2D and 3D images. How to manipulate those images through
More informationData Representation and Applets
Data Representation and Applets CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Overview Binary representation Data types revisited
More informationData Representation and Applets
Data Representation and Applets CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: http://www.csc.villanova.edu/~map/1051/
More informationData Representation and Applets
Data Representation and Applets CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: http://www.csc.villanova.edu/~map/1051/
More informationUnit 7: Event driven programming
Faculty of Computer Science Programming Language 2 Object oriented design using JAVA Dr. Ayman Ezzat Email: ayman@fcih.net Web: www.fcih.net/ayman Unit 7: Event driven programming 1 1. Introduction 2.
More informationJava Applet Basics. Life cycle of an applet:
Java Applet Basics Applet is a Java program that can be embedded into a web page. It runs inside the web browser and works at client side. Applet is embedded in a HTML page using the APPLET or OBJECT tag
More information@Override public void start(stage primarystage) throws Exception { Group root = new Group(); Scene scene = new Scene(root);
Intro to Drawing Graphics To draw some simple graphics, we first need to create a window. The easiest way to do this in the current version of Java is to create a JavaFX application. Previous versions
More informationOBJECT ORIENTED PROGRAMMING. Course 8 Loredana STANCIU Room B613
OBJECT ORIENTED PROGRAMMING Course 8 Loredana STANCIU loredana.stanciu@upt.ro Room B613 Applets A program written in the Java programming language that can be included in an HTML page A special kind of
More informationHere is a list of a few of the components located in the AWT and Swing packages:
Inheritance Inheritance is the capability of a class to use the properties and methods of another class while adding its own functionality. Programming In A Graphical Environment Java is specifically designed
More informationTWO-DIMENSIONAL FIGURES
TWO-DIMENSIONAL FIGURES Two-dimensional (D) figures can be rendered by a graphics context. Here are the Graphics methods for drawing draw common figures: java.awt.graphics Methods to Draw Lines, Rectangles
More informationCSC System Development with Java Introduction to Java Applets Budditha Hettige
CSC 308 2.0 System Development with Java Introduction to Java Applets Budditha Hettige Department of Statistics and Computer Science What is an applet? applet: a Java program that can be inserted into
More informationJava Coordinate System
Java Graphics Drawing shapes in Java such as lines, rectangles, 3-D rectangles, a bar chart, or a clock utilize the Graphics class Drawing Strings Drawing Lines Drawing Rectangles Drawing Ovals Drawing
More informationOutline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics
Topic 9: Swing Outline Swing = Java's GUI library Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 7: Expand moving shapes from Assignment 4 into game. "Programming
More informationSIMPLE APPLET PROGRAM
APPLETS Applets are small applications that are accessed on Internet Server, transported over Internet, automatically installed and run as a part of web- browser Applet Basics : - All applets are subclasses
More informationTopic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more
Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 5: Will be an open-ended Swing project. "Programming Contest"
More informationTopic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!
Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Why are we studying Swing? 1. Useful & fun! 2. Good application of OOP techniques
More informationAP CS Unit 12: Drawing and Mouse Events
AP CS Unit 12: Drawing and Mouse Events A JPanel object can be used as a container for other objects. It can also be used as an object that we can draw on. The first example demonstrates how to do that.
More informationBuilding Java Programs
Building Java Programs Graphics reading: Supplement 3G videos: Ch. 3G #1-2 Objects (briefly) object: An entity that contains data and behavior. data: variables inside the object behavior: methods inside
More informationData Representation and Applets
Data Representation and Applets CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: http://www.csc.villanova.edu/~map/1051/f13
More informationJava How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved.
Java How to Program, 9/e Copyright 1992-2012 by Pearson Education, Inc. All Rights Reserved. Overview capabilities for drawing two-dimensional shapes, controlling colors and controlling fonts. One of
More informationCompSci 230 S Programming Techniques. Basic GUI Components
CompSci 230 S1 2017 Programming Techniques Basic GUI Components Agenda Agenda Basic GUI Programming Concepts Graphical User Interface (GUI) Simple GUI-based Input/Output JFrame, JPanel & JLabel Using Layout
More informationMobile Systeme Grundlagen und Anwendungen standortbezogener Dienste. Location Based Services in the Context of Web 2.0
Mobile Systeme Grundlagen und Anwendungen standortbezogener Dienste Location Based Services in the Context of Web 2.0 Department of Informatics - MIN Faculty - University of Hamburg Lecture Summer Term
More informationChapter 14: Applets and More
Chapter 14: Applets and More Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 14 discusses the following main topics: Introduction to
More information8/23/2014. Chapter Topics. Introduction to Applets. Introduction to Applets. Introduction to Applets. Applet Limitations. Chapter 14: Applets and More
Chapter 14: Applets and More Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 14 discusses the following main topics: Introduction to
More informationGarfield AP CS. Graphics
Garfield AP CS Graphics Assignment 3 Working in pairs Conditions: I set pairs, you have to show me a design before you code You have until tomorrow morning to tell me if you want to work alone Cumulative
More informationChapter 14: Applets and More
Chapter 14: Applets and More Starting Out with Java: From Control Structures through Objects Fourth Edition by Tony Gaddis Addison Wesley is an imprint of 2010 Pearson Addison-Wesley. All rights reserved.
More information(0,0) (600, 400) CS109. PictureBox and Timer Controls
CS109 PictureBox and Timer Controls Let s take a little diversion and discuss how to draw some simple graphics. Graphics are not covered in the book, so you ll have to use these notes (or the built-in
More informationGraphics and Painting
Graphics and Painting Lecture 17 CGS 3416 Fall 2015 November 30, 2015 paint() methods Lightweight Swing components that extend class JComponent have a method called paintcomponent, with this prototype:
More information2IS45 Programming
Course Website Assignment Goals 2IS45 Programming http://www.win.tue.nl/~wsinswan/programmeren_2is45/ Rectangles Learn to use existing Abstract Data Types based on their contract (class Rectangle in Rectangle.
More informationBuilding Java Programs
Building Java Programs Supplement 3G: Graphics 1 drawing 2D graphics Chapter outline DrawingPanel and Graphics objects drawing and filling shapes coordinate system colors drawing with loops drawing with
More informationChapter 2 Exercise Solutions
Chapter 2 Exercise Solutions EX 2.1. EX 2.2. EX 2.3. EX 2.4. EX 2.5. Explain the following programming statement in terms of objects and the services they provide. System.out.println ("I gotta be me!");
More informationBuilding Java Programs
Building Java Programs Graphics reading: Supplement 3G videos: Ch. 3G #1-2 Objects (briefly) object: An entity that contains data and behavior. data: Variables inside the object. behavior: Methods inside
More informationCS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM
CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM Objectives The objectives of this assignment are: to get your first experience with Java to become familiar with Eclipse Java
More informationControl Statements: Part Pearson Education, Inc. All rights reserved.
1 5 Control Statements: Part 2 5.2 Essentials of Counter-Controlled Repetition 2 Counter-controlled repetition requires: Control variable (loop counter) Initial value of the control variable Increment/decrement
More informationAn Introduction to Processing
An Introduction to Processing Creating static drawings Produced by: Mairead Meagher Dr. Siobhán Drohan Department of Computing and Mathematics http://www.wit.ie/ Topics list Coordinate System in Computing.
More informationTopic 8 graphics. -mgrimes, Graphics problem report 134
Topic 8 graphics "What makes the situation worse is that the highest level CS course I've ever taken is cs4, and quotes from the graphics group startup readme like 'these paths are abstracted as being
More informationGraphics. Lecture 18 COP 3252 Summer June 6, 2017
Graphics Lecture 18 COP 3252 Summer 2017 June 6, 2017 Graphics classes In the original version of Java, graphics components were in the AWT library (Abstract Windows Toolkit) Was okay for developing simple
More informationCSC 1051 Algorithms and Data Structures I. Midterm Examination October 9, Name: KEY
CSC 1051 Algorithms and Data Structures I Midterm Examination October 9, 2014 Name: KEY Question Value Score 1 10 2 10 3 10 4 10 5 10 6 10 7 10 8 10 9 10 10 10 TOTAL 100 Please answer questions in the
More informationAplusBug dude = new AplusBug(); A+ Computer Science -
AplusBug dude = new AplusBug(); AplusBug dude = new AplusBug(); dude 0x234 AplusBug 0x234 dude is a reference variable that refers to an AplusBug object. A method is a storage location for related program
More informationUsing Graphics. Building Java Programs Supplement 3G
Using Graphics Building Java Programs Supplement 3G Introduction So far, you have learned how to: output to the console break classes/programs into static methods store and use data with variables write
More informationG51PRG: Introduction to Programming Second semester Applets and graphics
G51PRG: Introduction to Programming Second semester Applets and graphics Natasha Alechina School of Computer Science & IT nza@cs.nott.ac.uk Previous two lectures AWT and Swing Creating components and putting
More informationTopic 8 Graphics. Margaret Hamilton
Topic 8 Graphics When the computer crashed during the execution of your program, there was no hiding. Lights would be flashing, bells would be ringing and everyone would come running to find out whose
More informationCSC 1051 Algorithms and Data Structures I. Midterm Examination October 7, Name:
CSC 1051 Algorithms and Data Structures I Midterm Examination October 7, 2013 Name: Question Value Score 1 10 2 10 3 10 4 10 5 10 6 10 7 10 8 10 9 10 10 10 TOTAL 100 Please answer questions in the spaces
More informationBuilding Java Programs
Building Java Programs Graphics Reading: Supplement 3G Objects (briefly) object: An entity that contains data and behavior. data: variables inside the object behavior: methods inside the object You interact
More informationcs Java: lecture #5
cs3101-003 Java: lecture #5 news: homework #4 due today homework #5 out today today s topics: applets, networks, html graphics, drawing, handling images graphical user interfaces (GUIs) event handling
More informationTHE UNIVERSITY OF AUCKLAND
THE UNIVERSITY OF AUCKLAND SECOND SEMESTER, 2008 Campus: Tamaki COMPUTER SCIENCE TEST Software Design and Construction (Time allowed: 60 minutes) NOTE: Attempt ALL questions. Write your answers in the
More informationDesigning Classes Part 2
Designing Classes Part 2 CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/ Graphical
More informationCISC 1600 Lecture 3.1 Introduction to Processing
CISC 1600 Lecture 3.1 Introduction to Processing Topics: Example sketches Drawing functions in Processing Colors in Processing General Processing syntax Processing is for sketching Designed to allow artists
More informationPreparation: Get to know the Java coordinate system. 3. How is the background color of the window specified? Copy the exact code:
Lab 9 Name: Checked: Objectives: Introduction to graphics and JavaFX. Preparation: Get to know the Java coordinate system Download Snowman.java. Compile and run it to see the image it produces. 1. Note
More informationObject Orientated Programming in Java. Benjamin Kenwright
Graphics Object Orientated Programming in Java Benjamin Kenwright Outline Essential Graphical Principals JFrame Window (Popup Windows) Extending JFrame Drawing from paintcomponent Drawing images/text/graphics
More informationIn this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics.
Additional Controls, Scope, Random Numbers, and Graphics CS109 In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics. Combo
More informationGraphics -- To be discussed
Graphics -- To be discussed 1 Canvas Class... 1 2 Graphics Class... 1 3 Painting... 1 4 Color Models... 4 5 Animation's Worst Enemy: Flicker... 4 6 Working with Java Images... 5 6.1 Image Loading Chain
More informationGraphical User Interfaces
Graphical User Interfaces CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: http://www.csc.villanova.edu/~map/1051/
More informationExercise NMCGJ: Animated Graphics
Exercise NMCGJ: Animated Graphics Animation is a rapid display of a sequence of graphics or images which creates an illusion of movement. Animation is an important feature in game programming. In this
More informationGraphics and Java 2D Introduction OBJECTIVES. One picture is worth ten thousand words.
1 2 12 Graphics and Java 2D One picture is worth ten thousand words. Chinese proverb Treat nature in terms of the cylinder, the sphere, the cone, all in perspective. Paul Cézanne Colors, like features,
More informationCorel Draw 11. What is Vector Graphics?
Corel Draw 11 Corel Draw is a vector based drawing that program that makes it easy to create professional artwork from logos to intricate technical illustrations. Corel Draw 11's enhanced text handling
More informationGUI DYNAMICS Lecture July 26 CS2110 Summer 2011
GUI DYNAMICS Lecture July 26 CS2110 Summer 2011 GUI Statics and GUI Dynamics 2 Statics: what s drawn on the screen Components buttons, labels, lists, sliders, menus,... Containers: components that contain
More informationGraphical User Interfaces
Graphical User Interfaces CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Outline Pixels & bits & colors JavaFX Introduction
More informationCS177 Recitation. Graphics. Python Programming, 2/e 1
CS177 Recitation Graphics Python Programming, 2/e 1 Objectives To be familiar with the various graphic objects available in the graphics library. To understand the fundamental concepts of computer graphics,
More informationCSC 160 LAB 8-1 DIGITAL PICTURE FRAME. 1. Introduction
CSC 160 LAB 8-1 DIGITAL PICTURE FRAME PROFESSOR GODFREY MUGANDA DEPARTMENT OF COMPUTER SCIENCE 1. Introduction Download and unzip the images folder from the course website. The folder contains 28 images
More informationCSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random. Adapted from slides by Marty Stepp and Stuart Reges
CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random Adapted from slides by Marty Stepp and Stuart Reges Exercise: multiple parameters def main(): print_number(4, 9) print_number(17, 6) print_number(8,
More informationAdobe Flash CS3 Reference Flash CS3 Application Window
Adobe Flash CS3 Reference Flash CS3 Application Window When you load up Flash CS3 and choose to create a new Flash document, the application window should look something like the screenshot below. Layers
More informationDr. Hikmat A. M. AbdelJaber
Dr. Hikmat A. M. AbdelJaber Portion of the Java class hierarchy that include basic graphics classes and Java 2D API classes and interfaces. java.lang.object Java.awt.Color Java.awt.Component Java.awt.Container
More informationGraphical User Interfaces
Graphical User Interfaces CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: http://www.csc.villanova.edu/~map/1051/
More informationExpressions, Statements, and Control Structures
Expressions, Statements, and Control Structures Announcements Assignment 2 out, due next Wednesday, February 1. Explore the Java concepts we've covered and will be covering. Unleash your creative potential!
More informationUsing Flash Animation Basics
Using Flash Contents Using Flash... 1 Animation Basics... 1 Exercise 1. Creating a Symbol... 2 Exercise 2. Working with Layers... 4 Exercise 3. Using the Timeline... 6 Exercise 4. Previewing an animation...
More informationShared Collection of Java Course Materials: New Topics Covered. Agenda
Shared Collection of Java Course Materials: New Topics Covered Dragoslav Pešovi ović DAAD project Joint Course on OOP using Java Humboldt University Berlin, University of Novi Sad, Polytehnica University
More informationVariables, Types, and Expressions
Variables, Types, and Expressions Announcements Karel the Robot due right now. Email: Due Sunday, January 22 at 11:59PM. Update to assignment due dates: Assignments 2 5 going out one day later. Contact
More informationCommand-Line Applications. GUI Libraries GUI-related classes are defined primarily in the java.awt and the javax.swing packages.
1 CS257 Computer Science I Kevin Sahr, PhD Lecture 14: Graphical User Interfaces Command-Line Applications 2 The programs we've explored thus far have been text-based applications A Java application is
More informationCSc 110, Autumn 2016 Lecture 7: Graphics. Adapted from slides by Marty Stepp and Stuart Reges
CSc 110, Autumn 2016 Lecture 7: Graphics Adapted from slides by Marty Stepp and Stuart Reges Graphical objects We will draw graphics in Python using a new kind of object: DrawingPanel: A window on the
More informationCS 101 Computer Science I Fall Instructor Muller. stddraw API. (DRAFT of 1/15/2013)
CS 101 Computer Science I Fall 2013 Instructor Muller stddraw API (DRAFT of 1/15/2013) This document describes the application programmer interface (API) for the stddraw library. An API describes the set
More informationEXAMINATIONS 2016 TRIMESTER 2
EXAMINATIONS 2016 TRIMESTER 2 CGRA 151 INTRODUCTION TO COMPUTER GRAPHICS Time Allowed: TWO HOURS CLOSED BOOK Permitted materials: Silent non-programmable calculators or silent programmable calculators
More informationAgenda. Programming Seminar. By: dr. Amal Khalifa. Coordinate systems Colors Fonts Drawing shapes Graphics2D API
Agenda Coordinate systems Colors Fonts Drawing shapes Graphics2D API By: dr. Amal Khalifa 1 Programming Seminar @12:30 13:30 pm on Wednesday 9/4/2014 Location : 2.505.01 Painting components 2 Every component
More informationAssignment 2. Application Development
Application Development Assignment 2 Content Application Development Day 2 Lecture The lecture covers the key language elements of the Java programming language. You are introduced to numerical data and
More informationPhotocopiable/digital resources may only be copied by the purchasing institution on a single site and for their own use ZigZag Education, 2013
SketchUp Level of Difficulty Time Approximately 15 20 minutes Photocopiable/digital resources may only be copied by the purchasing institution on a single site and for their own use ZigZag Education, 2013
More informationSome classes and interfaces used in this chapter from Java s original graphics capabilities and from the Java2D API.
CHAPTER 11 513 11 java.lang.object java.awt.color java.awt.component Key class interface java.awt.font java.awt.fontmetrics java.awt.graphics java.awt.polygon Classes and interfaces from the Java2D API
More informationChapter 3 Syntax, Errors, and Debugging. Fundamentals of Java
Chapter 3 Syntax, Errors, and Debugging Objectives Construct and use numeric and string literals. Name and use variables and constants. Create arithmetic expressions. Understand the precedence of different
More information1. (10 pts) Order the following three images by how much memory they occupy:
CS 47 Prelim Tuesday, February 25, 2003 Problem : Raster images (5 pts). (0 pts) Order the following three images by how much memory they occupy: A. a 2048 by 2048 binary image B. a 024 by 024 grayscale
More informationAdobe Illustrator. Quick Start Guide
Adobe Illustrator Quick Start Guide 1 In this guide we will cover the basics of setting up an Illustrator file for use with the laser cutter in the InnovationStudio. We will also cover the creation of
More informationTOPIC 5 INTRODUCTION TO PICTURES
1 TOPIC 5 INTRODUCTION TO PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared by B. Ericson.
More informationAdvanced Internet Programming CSY3020
Advanced Internet Programming CSY3020 Java Applets The three Java Applet examples produce a very rudimentary drawing applet. An Applet is compiled Java which is normally run within a browser. Java applets
More informationTo get a copy of this image you right click on the image with your mouse and you will get a menu. Scroll down the menu and select "Save Image As".
The most popular lesson I teach is editing photographs. Everyone wants to put his or her brother's head on a monkey or something similar. This is also a lesson about "emphasis". You can cause more individuals
More informationGraphics and Java2D. Objectives
jhtp5_12.fm Page 569 Sunday, November 24, 2002 11:59 AM 12 Graphics and Java2D Objectives To understand graphics contexts and graphics objects. To understand and be able to manipulate colors. To understand
More informationCS Problem Solving and Object-Oriented Programming
CS 101 - Problem Solving and Object-Oriented Programming Lab 5 - Draw a Penguin Due: October 28/29 Pre-lab Preparation Before coming to lab, you are expected to have: Read Bruce chapters 1-3 Introduction
More informationPaint/Draw Tools. Foreground color. Free-form select. Select. Eraser/Color Eraser. Fill Color. Color Picker. Magnify. Pencil. Brush.
Paint/Draw Tools There are two types of draw programs. Bitmap (Paint) Uses pixels mapped to a grid More suitable for photo-realistic images Not easily scalable loses sharpness if resized File sizes are
More informationSession 7 MS Word. Graphics. Inserting Clipart, and Graphics Modify graphics Position graphics
Session 7 MS Word Graphics Inserting Clipart, and Graphics Modify graphics Position graphics Table of Contents Session 7 Working with Graphics... 1 The Toolbar... 1 Drawing Toolbar... 1 Picture Toolbar...
More informationCS 312 Midterm 1 Spring 2013
CS 312 Midterm 1 Spring 2013 Your Name KEY AND CRITERIA Problem Number Topic Points Possible 1 Expressions 11 2 Loop Evaluation 6 3 Method Tracing 10 4 Method Tracing 3 5 Writing Methods 5 6 Tracing Graphics
More informationText & Design 2015 Wojciech Piskor
Text & Design 2015 Wojciech Piskor www.wojciechpiskor.wordpress.com wojciech.piskor@gmail.com All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means,
More informationJava Programming Lecture 6
Java Programming Lecture 6 Alice E. Fischer Feb 15, 2013 Java Programming - L6... 1/32 Dialog Boxes Class Derivation The First Swing Programs: Snow and Moving The Second Swing Program: Smile Swing Components
More informationTOPIC 5 INTRODUCTION TO PICTURES
1 TOPIC 5 INTRODUCTION TO PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared by B. Ericson.
More informationCIS 162 Project 1 Business Card Section 04 (Kurmas)
CIS 162 Project 1 Business Card Section 04 (Kurmas) Due Date at the start of lab on Monday, 17 September (be prepared to demo in lab) Before Starting the Project Read zybook chapter 1 and 3 Know how to
More informationJava TM Applets. Rex Jaeschke
Java TM Applets Rex Jaeschke Java Applets 1997 1998, 2009 Rex Jaeschke. All rights reserved. Edition: 3.0 (matches JDK1.6/Java 2) All rights reserved. No part of this publication may be reproduced, stored
More informationChapter 1 Introducing Draw
Draw Guide Chapter 1 Introducing Draw Drawing Vector Graphics in LibreOffice Copyright This document is Copyright 2013 by its contributors as listed below. You may distribute it and/or modify it under
More information