Paint Application in Java Clark Jayson Cacal Aveline Germar Jose Sison Christopher Valera.

Slides:



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

2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Laboratory Study II October, Java Programming Assignment  Write a program to calculate and output the distance traveled by a car on a tank of.
Introduction to Programming
Graphics Programming. Introduction GOAL: Build the Indexer Client Event-driven vs. Sequential programs Terminology – Top-level windows are called “frame.
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.
Chapter 2 Programming by Example. A Holistic Perspective Three sections separated by blank lines. Program comment File: FileName.java
Georgia Institute of Technology Drawing in Java – part 2 Barb Ericson Georgia Institute of Technology September 2005.
CSC1401 Drawing in Java - 2. Reminder from last class How do you save your modified picture? String filename = …; Picture stevePicture = new Picture(filename);
©2004 Brooks/Cole Applets Graphics & GUIs. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Graphical Programs Most applications these days are.
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
1 L38 Graphics and Java 2D™ (3). 2 OBJECTIVES In this chapter you will learn:  To understand graphics contexts and graphics objects.  To understand.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 5 Applets and Graphics.
Color (1) Turtle class contains a method to change the pen color Note: before using Color class, you should add following line in the top of the source.
Image Representation.
Java Review Structure of a graphics program. Computer Graphics and User Interfaces Java is Object-Oriented A program uses objects to model the solution.
Graphics and Multimedia. Introduction The language contains many sophisticated drawing capabilities as part of namespace System.Drawing and the other.
1 Internet Graphics. 2 Representing Images  Raster Image: Images consist of “dots” of color, not lines  Pixel: Picture element-tiny rectangle  Resolution:
Color Names All standards-compliant browsers should handle these color names These color names can be used with the CSS properties of color and background-color.
©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.
Java Software Solutions Lewis and Loftus Chapter 7 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphics -- Introduction The.
1 Graphical User Components (II) Outline JTextArea Creating a Customized Subclass of JPanel JPanel Subclass that Handles Its Own Events Windows: Additional.
CS324e - Elements of Graphics and Visualization Compositing.
2D Graphics: Rendering Details
Chapter 15 Graphics and Java 2D™ Java How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 28 - Java Graphics and Java2D Outline 28.1Introduction.
Chapter 28 - Java Graphics and Java2D Outline 28.1Introduction 28.2Graphics Contexts and Graphics Objects 28.3Color Control 28.4Font Control 28.5Drawing.
 Pearson Education, Inc. All rights reserved. 1 Ch 12 Graphics and Java 2D In this chapter you will learn:  To understand graphics contexts.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 14 Java Fundamentals 2D Graphics Wed. 10/11/00.
Using the JImageViewer classes. JImageViewer classes JImageViewer class JImageViewer class ImagePanel class ImagePanel class Image class Image class.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/6/08.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
Graphics and Java 2D. 2 Introduction Java’s graphics capabilities –Drawing 2D shapes –Controlling colors –Controlling fonts Java 2D API –More sophisticated.
Chapter 2: Color and Applets Coming up: Introduction to Graphics.
Graphics & Applets CSC 1051 – Data Structures and Algorithms I
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
1 Building Java Programs Supplement 3G: Graphics These lecture notes are copyright (C) Marty Stepp and Stuart Reges, They may not be rehosted, sold,
(C) 2010 Pearson Education, Inc. All rights reserved.  Class Graphics (from package java.awt) provides various methods for drawing text and shapes onto.
Attributes of drawing elements
Merete S COLLEGEFACULTY OF ENGINEERING & SCIENCE Graphics ikt403 – Object-Oriented Software Development.
Java.  In java you can paint your own custom drawing (such as graphs, charts, drawings and, in particular, computer games) because you cannot find standard.
1 A first OpenGL program Brian Farrimond Robina Hetherington.
Graphics and Java2D Chapter Java Coordinate System Origin is in _____________ corner –Behind title bar of window X values increase to the ________.
Applets An applet is similar to a Java program, but it runs within a Web-browser on a client machine. For security, you cannot change anything on a client.
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,
1 Drawing C Sc 335 Object-Oriented Programming and Design Rick Mercer.
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.
Georgia Institute of Technology Drawing in Java – part 2 Dr Usman Saeed Assistant Professor Faculty of Computing and Information Technology North Jeddah.
CPCS 391 Computer Graphics Lab One. Computer Graphics Using Java What is Computer Graphics: Computer graphics are graphics created using computers and,
10/20/2005week71 Graphics, mouse and mouse motion events, KeyEvent Agenda Classes in AWT for graphics Example java programs –Graphics –Mouse events –Mouse.
Intro to Graphics from Chapter 2 of Java Software Solutions
12 Graphics and Java 2D™.
Chapter 02 Data and Expressions.
Data Representation Images.
Pixels, Colors and Shapes
Building Java Programs
Building Java Programs
Graphics and Multimedia
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
JAVA 2 Design and programming of GUI
Basic Graphics Drawing Shapes 1.
Computer Graphics.
Color Values All colors in computer images are a combination of red, green and blue Each component is encoded as a number means the color is.
4.14 GUI and Graphics Case Study: Creating Simple Drawings (Cont.)
Making the Applications Interesting
Building Java Programs
Graphics -- Introduction
Gradient Type 1 Gradient stops: 5 Stop #: 1 Position: 0
Presentation transcript:

Paint Application in Java Clark Jayson Cacal Aveline Germar Jose Sison Christopher Valera

Image Processing The image is colored per pixel. Each pixel has a RGB Value o 1 Byte Red Value o 1 Byte Green Value o 1 Byte Blue Value o Others have ARGB w/ 1 Byte Alpha Value (Transparency) (0,0) (14,0) (0,18) (14,18)

Image Processing Processor Monitor Memory

Java Graphics Packages Graphics Methods: Point (Abstract) Line Rect fillRect Oval fillOval Graphics2D Classes: Point (Abstract) Line Rectangle2D Ellipse2D

Graphics in Java Point (Graphics2D): o An abstract class- cannot be instantiated o Instead a very short line can be made Line Method (Graphics): o g.drawLine(x1, y1, x2, y2); Line Class (Graphics2D): o g.draw(new Line(x1, y1, x2, y2)); (x2, y2) (x1, y1)

Graphics in Java Rectangle Method (Graphics): o g.drawRect(posX, posY, width, height) Rectangle2D Class (Graphics2D): o g.draw(new Rectangle(posX, posY, width, height)) (posX, posY) width (posX, posY) height

Graphics in Java Oval Method (Graphics): o g.drawRect(posX, posY, width, height) Ellipse2D Class (Graphics2D): o g.draw(new Ellipse2D.Double(posX, posY, width, height)) (posX, posY) width (posX, posY) height

Draw Area Paint Program