IS311 Programming Concepts J AVA. Abstract Window Toolkit. (part 2: Graphics2D)

Size: px
Start display at page:

Download "IS311 Programming Concepts J AVA. Abstract Window Toolkit. (part 2: Graphics2D)"

Transcription

1 IS311 Programming Concepts J AVA Abstract Window Toolkit (part 2: Graphics2D)

2 Graphics2D เป น subclass ของ Graphics เพ มความสามารถ ในการควบค มร ปทรงเรขาคณ ตท ซ บซ อนมากข น เช น Draw lines of any thickness Fill shapes with gradients and textures Move, rotate, scale, and shear text and graphics Composite overlapping text and graphics

3 Drawing Shapes Old AWT way (can still use) drawxxxx fillxxxx OR - Create a Shape object and the draw or fill

4 Shape Interface To draw, use things that implement Shape such as: Area CubicCurve2D GeneralPath Line2D Polygon QuadCurve2D Rectangle RectangularShape These use double's or float's for parameters

5 Package java.awt.geom Classes and interfaces related to the definition of geometric primitives: AffineTransform Arc2D Arc2D.Double Arc2D.Float Area CubicCurve2D CubicCurve2D.Double CubicCurve2D.Float Dimension2D Ellipse2D Ellipse2D.Double Ellipse2D.Float FlatteningPathIterator GeneralPath Line2D Line2D.Double Line2D.Float PathIterator Point2D Point2D.Double Point2D.Float QuadCurve2D QuadCurve2D.Double QuadCurve2D.Float Rectangle2D Rectangle2D.Double Rectangle2D.Float RectangularShape RoundRectangle2D RoundRectangle2D.Double RoundRectangle2D.Float

6 Graphics2D object Used to draw Shape objects Has rendering attributes: Pen Style (solid, dotted, dashed) Fill Compositing (used when objects overlap) Transform (scale, rotate, translate, shear) Clip area Font

7 Graphics2D setting attributes setstroke() setpaint() pen style that is applied to the outline of a shape fill style that is applied to a shape's interior setcomposite() compositing style that is used when rendered objects overlap existing objects settransform() transform that is applied during rendering to convert the rendered object from user space to device-space coordinates setclip() setfont() restricts rendering to the area within the outline of the Shape font used to convert text strings to glyphs

8 Graphics2D Rendering Methods draw renders outline of graphics primitive using stroke and paint attributes fill fills shape with given paint attribute (color or pattern) drawstring draw string with given font and paint attribute drawimage draw an image

9 Graphics2D shape methods public void draw(shape s) Draws the outline of the given shape using this Graphics2D's current pen. public void fill(shape s) Draws outline and fills inside of given shape. rotate, scale, translate, shear, transform Perform various coordinate transformations on the Graphics2D context.

10 Shapes (in package java.awt.geom) Arc2D.Double(double x, double y, double w, double h, double start, double extent, int type) An arc, which is a portion of an ellipse. Ellipse2D.Double(double x, double y, double w, double h) An ellipse, which is a generalization of a circle. Line2D.Double(double x1, double y1, double x2, double y2) Line2D.Double(Point p1, Point p2) A line between two points.

11 Shapes Rectangle2D.Double(double x, double y, double w, double h) A rectangle, which is a generalization of a square. RoundRectangle2D.Double( double x, double y, double w, double h, double arcx, double arcy) A rounded rectangle. GeneralPath() A customizable polygon.

12 Methods of to all shapes public boolean contains(double x, double y) public boolean contains(point2d p) Whether the given point is contained inside the bounds of this shape. public Rectangle getbounds() A rectangle representing the bounding box around this shape. public double getcenterx() / getcentery() public double getminx() / getminy() public double getmaxx() / getmaxy() Various corner or center coordinates within the shape. public boolean intersects(double x, double y, double w, double h) public boolean intersects(rectangle2d r) Whether this shape touches the given rectangular region.

13 Creating Shapes public void paint(graphics g) { Graphics2D g2d = (Graphics2D)g; double x = 50.0; double y = 30.0; double diameter=150.0; Ellipse2D.Double circle = new Ellipse2D.double(x, y, diameter, diameter); g2d.fill(circle); }

14 Graphics2D draw and fill Arguments to the draw and fill must implement the Shape interface Graphics built using objects rather than instructions

15 Rectangles, Ellipses and ARcs Note that many Shape classes have inner constructors Use Rectangle2D inner classes to create: Rectangle2D.Double Retangle2D.Float Ellipse2D: Ellipse2D.Double Ellipse2D.Float Arc2D Arc2D.Double Arc2D.Float

16 Arc2D three different close types Open Pie Chord

17 Lines Create a line using Line2D classes inner class constructors Line2D.Float(), etc. Line2D.Double(), etc. QuadCurve2D 2 end points and a control points CubicCurve2D 2 end points and 2 control points

18 Bounds/Hit Testing Shape has various contains() methods Makes for easy user interaction public void mouseclicked(mouseevent e) { Point2D point = new Point2D.Double(e.getX(), e.gety()); if (shape.contains(point)) { showmessage( Hit me! ); } }

19 Constructive Area Geometry Constructive Area Geometry (CAG) is the process of creating new geometric shapes by performing boolean operations on existing ones. In the Java 2D API a special type of Shape called an Area supports boolean operations. Union (Add) Subtraction Intersection Exclusive-or(XOR) A pear shape from several ellipses

20 Combining Shapes Combine Shape objects using the Area class Area implements Shape can draw using Graphics2D Create: new Area() or new Area(Shape s) Combine: public void add(area a) public void intersect(area a); public void subtract(area a); public void exclusiveor(area a);

21 Painting Paint attribute of Graphics2D Goes way beyond the old color attribute (still useable) getpaint, setpaint Used when fill method is called on a shape Arguments to setpaint must implement the Paint interface

22 Paint related Classes of AWT Color Solid color Same constants as in AWT: Color.red, Color.black, etc. or mix your own Can be transparency GradientPaint Gradient fill gradually combining two colors Can create your own TexturePaint Tiled image as a paint background

23 Colors and paints java.awt.color (a simple single-colored paint) public Color(int r, int g, int b) public Color(int r, int g, int b, int alpha) a partially-transparent color (range 0-255, 0=transparent) public Color brighter(), darker() public static Color black, blue, cyan, darkgray, gray, green, lightgray, magenta, orange, pink, red, white, yellow java.awt.gradientpaint (smooth transition between 2 colors) public GradientPaint(float x1, float y1, Color color1, float x2, float y2, Color color2) java.awt.texturepaint (use an image as a "paint" background)

24 Compositing Process of putting two pictures together Every time object is drawn, source and destination combination process is performed Usually use source over destination

25 Transparency The AlphaComposite class encapsulates various compositing styles, which determine how overlapping objects are rendered. An AlphaComposite can also have an alpha value that specifies the degree of transparency: alpha = 1.0 is totally opaque, alpha = 0.0 totally transparent (clear). Assign transparency (alpha) values to drawing operations Underlying graphics show through Call setcomposite of Graphics2D object AlphaComposite.getInstance

26 Compositing Rules AlphaComposite supports most of the standard Porter-Duff compositing rules shown in the following table. The source pixels are rendered over the destination pixels Only the source pixels in the overlapping area are rendered Only the source pixels outside of the overlapping area are rendered If pixels in the source and the destination overlap, only the source pixels outside of the overlapping area are rendered If the alpha = 1.0, the pixels in the overlapping area are unchanged; if the alpha is 0.0, pixels in the overlapping area are cleared. If the alpha = 1.0, the pixels in the overlapping area are cleared; if the alpha is 0.0, the pixels in the overlapping area are unchanged

27 Using Local Fonts Same logical fonts as in Java 1.1 Serif, SansSerif, Monospaced, Dialog, DialogInput Also, arbitrary local fonts Must lookup entire list May take awhile Use GraphicsEnvironment methods getavailablefontfamilynames getallfonts

28 Printing All Font Names GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); String[] fontnames = env.getavailablefontfamilyname(); System.out.println("Available Fonts:"); for(int i=0; i<fontnames.length; i++) System.out.println(" " + fontnames[i]);

29 Drawing With Local Fonts - Example Query the available fonts using getavailablefontnames of GraphicsEnvironment Set the font in the Graphcis2D object Call g2d.drawstring method

30 Stroke Styles in Java 2D In the old Graphics class, could only do 1-pixel wide lines, no control over how lines are joined Much more flexibility in Java2D can specify: Pen thickness Dashing pattern The way line segments are joined together Create a BasicStroke object (several constructors)

31 Strokes (pen styles) Graphics2D public void setstroke(stroke s) Sets type of drawing pen (color, width, style) that will be used by this Graphics2D. java.awt.basicstroke A pen stroke for drawing outlines public BasicStroke(float width) public BasicStroke(float width, int cap, int join) public BasicStroke(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase) cap: CAP_BUTT, CAP_ROUND, CAP_SQUARE join: JOIN_BEVEL, JOIN_MITER, JOIN_ROUND

32 Coordinate Transformations Java 2D allows you to easily Translate Rotate Scale Shear Use java.awt.geom.affinetransform

33 Advanced: anti-aliasing Onscreen text and shapes can have jagged edges, or aliases. These can be removed by smoothing, or anti-aliasing, the panel. Graphics2D public void setrenderinghint( RenderingHints.Key key, Object value) Example: g2.setrenderinghint(renderinghints.key_antialiasing, RenderingHints.VALUE_ANTIALIAS_ON);

34 Other Capabilities of Java 2D High-quality printing Improved XOR mode Custom color mixing Fancy text operations Low-level image processing Animation

35 Resources 2D Graphics Tutorial

public void paintcomponent(graphics g) { Graphics2D g2 = (Graphics2D)g;... }

public void paintcomponent(graphics g) { Graphics2D g2 = (Graphics2D)g;... } 6.1 RANDERING The original JDK 1.0 had a very simple mechanism for drawing shapes. You select color and paint mode, and call methods of the Graphics class such as drawrect or filloval. The Java 2D API

More information

Software System Components 1 Graphics

Software System Components 1 Graphics Software System Components 1 Graphics Shan He LECTURE 3 Introduction to Java 2D Graphics (II) 1.1. Outline of Lecture Review of what we learned Rendering Shapes 1.2. Review of what we learned Last lecture,

More information

Java How to Program, 9/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java 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 information

Overview. Java2D. Graphics in Java2D: Colour Images Fonts. The bigger picture of Java Graphics: Java Advanced Imaging (JAI) API Java3D

Overview. Java2D. Graphics in Java2D: Colour Images Fonts. The bigger picture of Java Graphics: Java Advanced Imaging (JAI) API Java3D Graphics in Java2D: Colour Images Fonts Overview The bigger picture of Java Graphics: Java Advanced Imaging (JAI) API Java3D The bigger picture of Java multimedia ITNP80: Multimedia 1 ITNP80: Multimedia

More information

Class Meeting 05 (Lecture 04) Objectives for this class meeting. Conduct vote on basic style of game for class project

Class Meeting 05 (Lecture 04) Objectives for this class meeting. Conduct vote on basic style of game for class project CSE1720 Click to edit Master Week text 02, styles Class Meeting 05 (Lecture 04) Second level Third level Fourth level Fifth level Winter 2013 Thursday, January 17, 2013 1 Objectives for this class meeting

More information

Graphics and Painting

Graphics 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 information

Basic Principles of Two-Dimensional Graphics

Basic Principles of Two-Dimensional Graphics Basic Principles of Two-Dimensional Graphics 2 This chapter introduces basic concepts that are required for the understanding of two-dimensional graphics. Almost all output devices for graphics like computer

More information

Week 4 Part 2. Introduction to 2D Graphics & Java 2D

Week 4 Part 2. Introduction to 2D Graphics & Java 2D Week 4 Part 2 Introduction to 2D Graphics & Java 2D 2D graphics Vector graphics! Use of geometric primitives: points, lines, curves, etc.! Primitives are created by using mathematical equations! Can be

More information

Graphics and Java 2D Introduction OBJECTIVES. One picture is worth ten thousand words.

Graphics 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 information

CHAPTER. Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION CHAPTER CONTENTS Writing to the Console

CHAPTER. Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION CHAPTER CONTENTS Writing to the Console CHAPTER 2 Introduction to Classes and Objects CHAPTER CONTENTS 2.1 Thinking Objectively 2.6 The DrawingKit Class 2.2 Creating NOT FOR Objects SALE OR DISTRIBUTION 2.7 Creating and Displaying NOT FOR Graphics

More information

2. (10 pts) Which of the following classes implements the Shape interface? Circle all that apply. a) Ellipse2D b) Area c) Stroke d) AffineTransform e)

2. (10 pts) Which of the following classes implements the Shape interface? Circle all that apply. a) Ellipse2D b) Area c) Stroke d) AffineTransform e) CS 324E Elements of Computer Graphics Fall 2002 Midterm NAME: Please write your answers on THESE SHEETS. If you must turn in extra sheets, put your name on each one of them. You should not need substantial

More information

Graphics. Lecture 18 COP 3252 Summer June 6, 2017

Graphics. 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 information

AWT COLOR CLASS. Introduction. Class declaration. Field

AWT COLOR CLASS. Introduction. Class declaration. Field http://www.tutorialspoint.com/awt/awt_color.htm AWT COLOR CLASS Copyright tutorialspoint.com Introduction The Color class states colors in the default srgb color space or colors in arbitrary color spaces

More information

Agenda. Programming Seminar. By: dr. Amal Khalifa. Coordinate systems Colors Fonts Drawing shapes Graphics2D API

Agenda. 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 information

(C) 2010 Pearson Education, Inc. All rights reserved. Omer Boyaci

(C) 2010 Pearson Education, Inc. All rights reserved. Omer Boyaci Omer Boyaci A sprite must monitor the game environment, for example, reacting to collisions with different sprites or stopping when it encounters an obstacle. Collision processing can be split into two

More information

Output models Drawing Rasterization Color models

Output models Drawing Rasterization Color models Output models Drawing Rasterization olor models Fall 2004 6.831 UI Design and Implementation 1 Fall 2004 6.831 UI Design and Implementation 2 omponents Graphical objects arranged in a tree with automatic

More information

03 Vector Graphics. Multimedia Systems. 2D and 3D Graphics, Transformations

03 Vector Graphics. Multimedia Systems. 2D and 3D Graphics, Transformations Multimedia Systems 03 Vector Graphics 2D and 3D Graphics, Transformations Imran Ihsan Assistant Professor, Department of Computer Science Air University, Islamabad, Pakistan www.imranihsan.com Lectures

More information

How to draw and create shapes

How to draw and create shapes Adobe Flash Professional Guide How to draw and create shapes You can add artwork to your Adobe Flash Professional documents in two ways: You can import images or draw original artwork in Flash by using

More information

Lecture 11: Output 2. Fall UI Design and Implementation 1

Lecture 11: Output 2. Fall UI Design and Implementation 1 Lecture 11: Output 2 Fall 2006 6.831 UI Design and Implementation 1 1 UI Hall of Fame or Shame? Fall 2006 6.831 UI Design and Implementation 2 Here s our hall of fame example. StatCounter is a web site

More information

Graphics and Java2D. Objectives

Graphics 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 information

Object Oriented Programming

Object Oriented Programming Object Oriented Programming 1. Event handling in Java 2. Introduction to Java Graphics OOP9 - M. Joldoş - T.U. Cluj 1 Reminder: What is a callback? Callback is a scheme used in event-driven programs where

More information

Paint Tutorial (Project #14a)

Paint Tutorial (Project #14a) Paint Tutorial (Project #14a) In order to learn all there is to know about this drawing program, go through the Microsoft Tutorial (below). (Do not save this to your folder.) Practice using the different

More information

9/20/10. Learning Goals. Drawing in Java. How to Show a Picture. How to Create a Picture Object. Strings. String Methods

9/20/10. Learning Goals. Drawing in Java. How to Show a Picture. How to Create a Picture Object. Strings. String Methods Learning Goals Drawing in Java Barb Ericson Georgia Institute of Technology Sept 2010 Understand at a conceptual and practical level Class methods String objects and methods How to use comments in a Java

More information

Graphics in Swing. Engineering 5895 Faculty of Engineering & Applied Science Memorial University of Newfoundland

Graphics in Swing. Engineering 5895 Faculty of Engineering & Applied Science Memorial University of Newfoundland Graphics in Swing Engineering 5895 Faculty of Engineering & Applied Science Memorial University of Newfoundland 1 paintcomponent and repaint Each Swing component has the following paint methods: void paintcomponent(

More information

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created.

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created. + Inheritance + Inheritance Classes that we design in Java can be used to model some concept in our program. For example: Pokemon a = new Pokemon(); Pokemon b = new Pokemon() Sometimes we need to create

More information

Paint/Draw Tools. Foreground color. Free-form select. Select. Eraser/Color Eraser. Fill Color. Color Picker. Magnify. Pencil. Brush.

Paint/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 information

This is the vector graphics "drawing" technology with its technical and creative beauty. SVG Inkscape vectors

This is the vector graphics drawing technology with its technical and creative beauty. SVG Inkscape vectors 1 SVG This is the vector graphics "drawing" technology with its technical and creative beauty SVG Inkscape vectors SVG 2 SVG = Scalable Vector Graphics is an integrated standard for drawing Along with

More information

CS 160: Lecture 10. Professor John Canny Spring 2004 Feb 25 2/25/2004 1

CS 160: Lecture 10. Professor John Canny Spring 2004 Feb 25 2/25/2004 1 CS 160: Lecture 10 Professor John Canny Spring 2004 Feb 25 2/25/2004 1 Administrivia In-class midterm on Friday * Closed book (no calcs or laptops) * Material up to last Friday Lo-Fi Prototype assignment

More information

Creating a 2D Geometry Model

Creating a 2D Geometry Model Creating a 2D Geometry Model This section describes how to build a 2D cross section of a heat sink and introduces 2D geometry operations in COMSOL. At this time, you do not model the physics that describe

More information

Building Java Programs

Building 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 information

Einführung in Visual Computing

Einführung in Visual Computing Einführung in Visual Computing 186.822 Rasterization Werner Purgathofer Rasterization in the Rendering Pipeline scene objects in object space transformed vertices in clip space scene in normalized device

More information

Using Graphics. Building Java Programs Supplement 3G

Using 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 information

Lecture 5: Java Graphics

Lecture 5: Java Graphics Lecture 5: Java Graphics CS 62 Spring 2019 William Devanny & Alexandra Papoutsaki 1 New Unit Overview Graphical User Interfaces (GUI) Components, e.g., JButton, JTextField, JSlider, JChooser, Containers,

More information

Computer Graphics. Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1

Computer Graphics. Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1 Computer Graphics Chapter 4 Attributes of Graphics Primitives Somsak Walairacht, Computer Engineering, KMITL 1 Outline OpenGL State Variables Point Attributes t Line Attributes Fill-Area Attributes Scan-Line

More information

Adding Objects Creating Shapes Adding. Text Printing and Exporting Getting Started Creating a. Creating Shapes Adding Text Printing and Exporting

Adding Objects Creating Shapes Adding. Text Printing and Exporting Getting Started Creating a. Creating Shapes Adding Text Printing and Exporting Getting Started Creating a Workspace Pages, Masters and Guides Adding Objects Creating Shapes Adding Text Printing and Exporting Getting Started Creating a Workspace Pages, Masters and Guides Adding Objects

More information

Core Graphics and OpenGL ES. Dr. Sarah Abraham

Core Graphics and OpenGL ES. Dr. Sarah Abraham Core Graphics and OpenGL ES Dr. Sarah Abraham University of Texas at Austin CS329e Fall 2018 Core Graphics Apple s vector-drawing framework Previously known as Quartz or Quartz2D Includes handling for:

More information

Chapter 6 Formatting Graphic Objects

Chapter 6 Formatting Graphic Objects Impress Guide Chapter 6 OpenOffice.org Copyright This document is Copyright 2007 by its contributors as listed in the section titled Authors. You can distribute it and/or modify it under the terms of either

More information

9Introducing. Concurrency with Threads

9Introducing. Concurrency with Threads 9Introducing Concurrency with Threads 118 Chapter 9: Introducing Concurrency with Threads Self-review Questions 9.1 What is a thread? A thread is a single path of execution through a program that can be

More information

The process of making a selection is fundamental to all Photoshop

The process of making a selection is fundamental to all Photoshop 102640 ch15.1.qxp 3/10/07 11:23 AM Page 303 Making Selections The process of making a selection is fundamental to all Photoshop documents. A selection isolates an area of an image so that you can apply

More information

Building Java Programs

Building 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 information

CISC 1600 Lecture 3.1 Introduction to Processing

CISC 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 information

Putting the 'Free' into JFreeChart

Putting the 'Free' into JFreeChart Putting the 'Free' into JFreeChart 25 February 2006 Dave Gilbert JFreeChart Project Leader Overview The Java Trap; JFreeChart; Java2D (Graphics2D); The Free Stack: Cairo (CairoGraphics2D); GNU Classpath;

More information

5 Drawing Stuff in 2D

5 Drawing Stuff in 2D 16 Advanced Java for Bioinformatics, WS 17/18, D. Huson, November 6, 2017 5 Drawing Stuff in 2D The scene graph is a tree whose nodes are layout items, controls and, as we will see, graphic objects. JavaFX

More information

Lecture 3: Java Graphics & Events

Lecture 3: Java Graphics & Events Lecture 3: Java Graphics & Events CS 62 Fall 2017 Kim Bruce & Alexandra Papoutsaki Text Input Scanner class Constructor: myscanner = new Scanner(System.in); can use file instead of System.in new Scanner(new

More information

Inkscape Tutorial. v2.0. Simon Andrews.

Inkscape Tutorial. v2.0. Simon Andrews. Inkscape Tutorial v2.0 Simon Andrews simon.andrews@babraham.ac.uk What is Inkscape? Vector Graphics Editor Free Software Cross Platform Easy to use Good for: Compositing Drawing Not for: Bitmap editing

More information

AWT QUADCURVE2D CLASS

AWT QUADCURVE2D CLASS AWT QUADCURVE2D CLASS http://www.tutorialspoint.com/awt/awt_quadcurve2d_class.htm Copyright tutorialspoint.com Introduction The QuadCurve2D class states a quadratic parametric curve segment in x, y coordinate

More information

1.00 Lecture 14. Lecture Preview

1.00 Lecture 14. Lecture Preview 1.00 Lecture 14 Introduction to the Swing Toolkit Lecture Preview Over the next 5 lectures, we will introduce you to the techniques necessary to build graphic user interfaces for your applications. Lecture

More information

Google SketchUp. and SketchUp Pro 7. The book you need to succeed! CD-ROM Included! Kelly L. Murdock. Master SketchUp Pro 7 s tools and features

Google SketchUp. and SketchUp Pro 7. The book you need to succeed! CD-ROM Included! Kelly L. Murdock. Master SketchUp Pro 7 s tools and features CD-ROM Included! Free version of Google SketchUp 7 Trial version of Google SketchUp Pro 7 Chapter example files from the book Kelly L. Murdock Google SketchUp and SketchUp Pro 7 Master SketchUp Pro 7 s

More information

Class 14: Introduction to the Swing Toolkit

Class 14: Introduction to the Swing Toolkit Introduction to Computation and Problem Solving Class 14: Introduction to the Swing Toolkit Prof. Steven R. Lerman and Dr. V. Judson Harward 1 Class Preview Over the next 5 lectures, we will introduce

More information

Computer Graphics. Chapter 4 Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1

Computer Graphics. Chapter 4 Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1 Computer Graphics Chapter 4 Attributes of Graphics Primitives Somsak Walairacht, Computer Engineering, KMITL 1 Outline OpenGL State Variables Point Attributes Line Attributes Fill-Area Attributes Scan-Line

More information

Topic 8 Graphics. Margaret Hamilton

Topic 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 information

INKSCAPE INTRODUCTION COMPONENTS OF INKSCAPE MENU BAR

INKSCAPE INTRODUCTION COMPONENTS OF INKSCAPE MENU BAR INKSCAPE Prepared by K. Srujana INTRODUCTION Inkscape began in 2003 as a code fork of the Sodipodia project. Sodipodi, developed since 1999, was itself based on Rsph Levien's Gill (Gnome Illustration Application).

More information

After completing each task, be sure to save the file in the My Documents folder on your computer using the suggested name.

After completing each task, be sure to save the file in the My Documents folder on your computer using the suggested name. PowerPoint Basic PPT2K13B Final Assignment This is the final assignment for the PowerPoint Basic course. Before attempting to complete this evaluation, you should have completed all Lessons Presentations,

More information

Some classes and interfaces used in this chapter from Java s original graphics capabilities and from the Java2D API.

Some 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 information

Building Java Programs

Building 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 information

How to...create a Video VBOX Gauge in Inkscape. So you want to create your own gauge? How about a transparent background for those text elements?

How to...create a Video VBOX Gauge in Inkscape. So you want to create your own gauge? How about a transparent background for those text elements? BASIC GAUGE CREATION The Video VBox setup software is capable of using many different image formats for gauge backgrounds, static images, or logos, including Bitmaps, JPEGs, or PNG s. When the software

More information

Garfield AP CS. Graphics

Garfield 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 information

2D Graphics. Shape Models, Drawing, Selection. CS d Graphics 1

2D Graphics. Shape Models, Drawing, Selection. CS d Graphics 1 2D Graphics Shape Models, Drawing, Selection 1 Graphic Models vs. Images Computer Graphics: the creation, storage, and manipulation of images and their models Model: a mathematical representation of an

More information

Corel Draw 11. What is Vector Graphics?

Corel 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 information

CompSci 230 S Programming Techniques. Basic GUI Components

CompSci 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 information

Graphics JFrame. import java.awt.*; import javax.swing.*; public class XXX extends JFrame { public XXX() { ... main() public static

Graphics JFrame. import java.awt.*; import javax.swing.*; public class XXX extends JFrame { public XXX() { ... main() public static Graphics 2006.11.22 1 1.1 javax.swing.* JFrame JFrame public class XXX extends JFrame { public XXX() { //... // ( )... main() public static public class XXX extends JFrame { public XXX() { setdefaultcloseoperation(jframe.exit_on_close);

More information

Graphics (Output) Primitives. Chapters 3 & 4

Graphics (Output) Primitives. Chapters 3 & 4 Graphics (Output) Primitives Chapters 3 & 4 Graphic Output and Input Pipeline Scan conversion converts primitives such as lines, circles, etc. into pixel values geometric description a finite scene area

More information

Adobe Flash CS4 Part 1: Introduction to Flash

Adobe Flash CS4 Part 1: Introduction to Flash CALIFORNIA STATE UNIVERSITY, LOS ANGELES INFORMATION TECHNOLOGY SERVICES Adobe Flash CS4 Part 1: Introduction to Flash Fall 2010, Version 1.0 Table of Contents Introduction...3 Downloading the Data Files...3

More information

Java Programming Lecture 6

Java 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 information

CSE115 Lab 4 Fall 2016

CSE115 Lab 4 Fall 2016 DUE DATES: Monday recitations: 9:00 PM on 10/09 Wednesday recitations: 9:00 PM on 10/11 Thursday recitations: 9:00 PM on 10/12 Friday recitations: 9:00 PM on 10/13 Saturday recitations: 9:00 PM on 10/14

More information

the gamedesigninitiative at cornell university Lecture 16 Color and Textures

the gamedesigninitiative at cornell university Lecture 16 Color and Textures Lecture 6 Color and Textures Take Away For Today Image color and composition What is RGB model for images? What does alpha represent? How does alpha composition work? Graphics primitives How do primitives

More information

EXAMINATIONS 2016 TRIMESTER 2

EXAMINATIONS 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 information

Topic 8 graphics. -mgrimes, Graphics problem report 134

Topic 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 information

the gamedesigninitiative at cornell university Lecture 17 Color and Textures

the gamedesigninitiative at cornell university Lecture 17 Color and Textures Lecture 7 Color and Textures Take Away For Today Image color and composition What is RGB model for images? What does alpha represent? How does alpha composition work? Graphics primitives How do primitives

More information

the gamedesigninitiative at cornell university Lecture 17 Color and Textures

the gamedesigninitiative at cornell university Lecture 17 Color and Textures Lecture 7 Color and Textures Take Away For Today Image color and composition What is RGB model for images? What does alpha represent? How does alpha composition work? Graphics primitives How do primitives

More information

Ai Adobe. Illustrator. Creative Cloud Beginner

Ai Adobe. Illustrator. Creative Cloud Beginner Ai Adobe Illustrator Creative Cloud Beginner Vector and pixel images There are two kinds of images: vector and pixel based images. A vector is a drawn line that can be filled with a color, pattern or gradient.

More information

ADOBE ILLUSTRATOR CS3

ADOBE ILLUSTRATOR CS3 ADOBE ILLUSTRATOR CS3 Chapter 2 Creating Text and Gradients Chapter 2 1 Creating type Create and Format Text Create text anywhere Select the Type Tool Click the artboard and start typing or click and drag

More information

Introduction p. 1 Java Features p. 2 Java Expansion p. 4 Getting, Setting Up, and Using Java p. 5 The Java Language p. 5 Java Swing Components p.

Introduction p. 1 Java Features p. 2 Java Expansion p. 4 Getting, Setting Up, and Using Java p. 5 The Java Language p. 5 Java Swing Components p. Introduction p. 1 Java Features p. 2 Java Expansion p. 4 Getting, Setting Up, and Using Java p. 5 The Java Language p. 5 Java Swing Components p. 6 Components, Containers, and Layour Management p. 6 Checkboxes,

More information

Scalable Vector Graphics (SVG) vector image World Wide Web Consortium (W3C) defined with XML searched indexed scripted compressed Mozilla Firefox

Scalable Vector Graphics (SVG) vector image World Wide Web Consortium (W3C) defined with XML searched indexed scripted compressed Mozilla Firefox SVG SVG Scalable Vector Graphics (SVG) is an XML-based vector image format for twodimensional graphics with support for interactivity and animation. The SVG specification is an open standard developed

More information

The Racket Drawing Toolkit

The Racket Drawing Toolkit The Racket Drawing Toolkit Version 6.12.0.3 Matthew Flatt, Robert Bruce Findler, and John Clements February 14, 2018 (require racket/draw) package: draw-lib The racket/draw library provides all of the

More information

1. Complete these exercises to practice creating user functions in small sketches.

1. Complete these exercises to practice creating user functions in small sketches. Lab 6 Due: Fri, Nov 4, 9 AM Consult the Standard Lab Instructions on LEARN for explanations of Lab Days ( D1, D2, D3 ), the Processing Language and IDE, and Saving and Submitting. Rules: Do not use the

More information

Letterkenny Institute of Technology

Letterkenny Institute of Technology Letterkenny Institute of Technology BSc in Computing in Games Development Subject: Games Programming 1 Level: 7 Date: Autumn 2008 Examiners: Dr. J.G. Campbell Dr. M.D.J. McNeill Time Allowed: Two hours.

More information

CONTENTS IN DETAIL. What s in This Book?... xx Who Is This Book For?... xx

CONTENTS IN DETAIL. What s in This Book?... xx Who Is This Book For?... xx CONTENTS IN DETAIL ACKNOWLEDGMENTS xvii INTRODUCTION xix What s in This Book?... xx Who Is This Book For?... xx 1 INKSCAPE AND THE WORLD 1.1 What Vector Graphics Is and Why It Matters... 1.2 What Can You

More information

Part 7 More fill styles and an effect

Part 7 More fill styles and an effect Part 7 More fill styles and an effect Introduction To break the uniformity of the grass fill style, this part will continue creating fill styles and adding sheets show how to copy fill styles show how

More information

Part 1: Basics. Page Sorter:

Part 1: Basics. Page Sorter: Part 1: Basics Page Sorter: The Page Sorter displays all the pages in an open file as thumbnails and automatically updates as you add content. The page sorter can do the following. Display Pages Create

More information

Week 5: Images & Graphics. Programming of Interactive Systems. JavaFX Images. images. Anastasia Bezerianos. Anastasia Bezerianos

Week 5: Images & Graphics. Programming of Interactive Systems. JavaFX Images. images. Anastasia Bezerianos. Anastasia Bezerianos Programming of Interactive Systems Week 5: Images & Graphics Anastasia Bezerianos introduction.prog.is@gmail.com Anastasia Bezerianos introduction.prog.is@gmail.com!2 1 2 JavaFX Images images In JavaFX

More information

Creative Effects with Illustrator

Creative Effects with Illustrator ADOBE ILLUSTRATOR Creative Effects with Illustrator PREVIEW OVERVIEW The object is to create a poster with a unified color scheme by compositing artwork drawn in Illustrator with various effects and photographs.

More information

Drawing shapes and lines

Drawing shapes and lines Fine F Fi i Handmade H d d Ch Chocolates l Hours Mon Sat 10am 6pm In this demonstration of Adobe Illustrator CS6, you will be introduced to new and exciting application features, like gradients on a stroke

More information

Java TM Applets. Rex Jaeschke

Java 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 information

CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM

CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM Introduction to the Assignment In this assignment, you will get practice with recursion. There are three parts

More information

QuickTutor. An Introductory SilverScreen Modeling Tutorial. Solid Modeler

QuickTutor. An Introductory SilverScreen Modeling Tutorial. Solid Modeler QuickTutor An Introductory SilverScreen Modeling Tutorial Solid Modeler TM Copyright Copyright 2005 by Schroff Development Corporation, Shawnee-Mission, Kansas, United States of America. All rights reserved.

More information

Xyron Wishblade Software Manual (PC)

Xyron Wishblade Software Manual (PC) Xyron Wishblade Software Manual (PC) Provided By http://www.mybinding.com http://www.mybindingblog.com Xyron Wishblade Create & Cut Software Manual Section 1 Getting Started with Tool Bars 2 Standard Tool

More information

Advanced Special Effects

Advanced Special Effects Adobe Illustrator Advanced Special Effects AI exercise preview exercise overview The object is to create a poster with a unified color scheme by compositing artwork drawn in Illustrator with various effects

More information

An Introduction to Processing

An 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 information

Pen Tool, Fill Layers, Color Range, Levels Adjustments, Magic Wand tool, and shadowing techniques

Pen Tool, Fill Layers, Color Range, Levels Adjustments, Magic Wand tool, and shadowing techniques Creating a superhero using the pen tool Topics covered: Pen Tool, Fill Layers, Color Range, Levels Adjustments, Magic Wand tool, and shadowing techniques Getting Started 1. Reset your work environment

More information

AWT GRAPHICS CLASS. Introduction. Class declaration. Class constructors. Class methods

AWT GRAPHICS CLASS. Introduction. Class declaration. Class constructors. Class methods AWT GRAPHICS CLASS http://www.tutorialspoint.com/awt/awt_graphics_class.htm Copyright tutorialspoint.com Introduction The Graphics class is the abstract super class for all graphics contexts which allow

More information

Graphics Hit-testing. Shape Models Selecting Lines and Shapes. 2.7 Graphics Hit-testing 1

Graphics Hit-testing. Shape Models Selecting Lines and Shapes. 2.7 Graphics Hit-testing 1 Graphics Hit-testing Shape Models Selecting Lines and Shapes 2.7 Graphics Hit-testing 1 Recap - Graphic Models and Images Computer Graphics is the creation, storage, and manipulation of images and their

More information

Module 5: Creating Sheet Metal Transition Piece Between a Square Tube and a Rectangular Tube with Triangulation

Module 5: Creating Sheet Metal Transition Piece Between a Square Tube and a Rectangular Tube with Triangulation 1 Module 5: Creating Sheet Metal Transition Piece Between a Square Tube and a Rectangular Tube with Triangulation In Module 5, we will learn how to create a 3D folded model of a sheet metal transition

More information

PostScript Internals Graphics II Spring 1999

PostScript Internals Graphics II Spring 1999 PostScript Internals 15-463 Graphics II Spring 1999 Background PostScript raster image processor for Mac All Level 1 features Some support for color and multi-bit devices Undergrad independent study: MacRIP

More information

Solid Bodies and Disjointed bodies

Solid Bodies and Disjointed bodies Solid Bodies and Disjointed bodies Generally speaking when modelling in Solid Works each Part file will contain single solid object. As you are modelling, each feature is merged or joined to the previous

More information

Illustrator 1 Object Creation and Modification Tools

Illustrator 1 Object Creation and Modification Tools Illustrator 1 Object Creation and Modification Tools Pen Tool Creates a precision shape using points and curve handles. Shape Tools Creates geometric solids. Selection Tool Selects objects and groups.

More information

Krita Vector Tools

Krita Vector Tools Krita 2.9 05 Vector Tools In this chapter we will look at each of the vector tools. Vector tools in Krita, at least for now, are complementary tools for digital painting. They can be useful to draw clean

More information

Recipes4Success. Draw and Animate a Rocket Ship. Frames 5 - Drawing Tools

Recipes4Success. Draw and Animate a Rocket Ship. Frames 5 - Drawing Tools Recipes4Success You can use the drawing tools and path animation tools in Frames to create illustrated cartoons. In this Recipe, you will draw and animate a rocket ship. 2012. All Rights Reserved. This

More information

Adobe Photoshop Sh S.K. Sublania and Sh. Naresh Chand

Adobe Photoshop Sh S.K. Sublania and Sh. Naresh Chand Adobe Photoshop Sh S.K. Sublania and Sh. Naresh Chand Photoshop is the software for image processing. With this you can manipulate your pictures, either scanned or otherwise inserted to a great extant.

More information

MET 107 Drawing Tool (Shapes) Notes Day 3

MET 107 Drawing Tool (Shapes) Notes Day 3 MET 107 Drawing Tool (Shapes) Notes Day 3 Shapes: (Insert Tab Shapes) Example: Select on the rounded rectangle Then use the mouse to position the upper left corner and produce the size by dragging out

More information