(PART II) Graphics and Multimedia. Font Control Font s  After a Font is created, its properties cannot be modified  Programmers must create a new Font.

Slides:



Advertisements
Similar presentations
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 30 - Dynamic HTML: Structured Graphics ActiveX Control Outline 30.1Introduction 30.2Shape Primitives.
Advertisements

Laboratory Study II October, Java Programming Assignment  Write a program to calculate and output the distance traveled by a car on a tank of.
Graphics Chapter 16.  If you want to draw shapes such as a bar chart, a clock, or a stop sign, how do you do it?
1 Drawing C Sc 335 Object-Oriented Programming and Design Rick Mercer.
Graphics and Multimedia Session 13 Mata kuliah: M0874 – Programming II Tahun: 2010.
1 Chapter 15 l Basic Figures l Colors l Fonts and Other Text Details Graphics Objects.
©2004 Brooks/Cole Applets Graphics & GUIs. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Graphical Programs Most applications these days are.
GUI-Labels, TextBoxes and Buttons Label- displays read-only text Common properties:  Font – font used by the text of label  Text – text to appear on.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Topics  Applets  Classes used for graphics Graphics Point Dimension.
Slides prepared by Rose Williams, Binghamton University Chapter 19 Swing II.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 5 Java Graphics Applets.
Graphics and Multimedia. Outline Introduction Graphics Contexts and Graphics Objects Color Control.
GUI-Labels, TextBoxes and Buttons Label- displays read-only text Label- displays read-only text Common properties: Common properties: Font – font used.
Računarska grafika GDI+ (Graphics Device Interface Plus)
Graphics and Multimedia. Introduction The language contains many sophisticated drawing capabilities as part of namespace System.Drawing and the other.
Graphics Images – PictureBox control Drawing graphics - Graphics object Multimedia controls PictureBox control Image property – select image Choose how.
1 Chapter 26 D&D – Graphics Outline 26.1 Introduction 26.3 Graphics Contexts and Graphics Objects 26.4 Color Control 26.5 Font Control 26.6 Drawing Lines,
CS324e - Elements of Graphics and Visualization Java2D Graphics.
Chapter 16: Graphics. Objectives Learn about the paint() and repaint() methods Use the drawString() method to draw String s using various fonts and colors.
1 Interface Types & Polymorphism & introduction to graphics programming in Java.
©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.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 26 – CheckWriter Application Introducing Graphics.
1 Windows Graphics. 2 Objectives You will be able to Use the Windows GDI+ to draw arbitrary figures and text on a Windows form. Add a handler for the.
1 Graphical User Components (II) Outline JTextArea Creating a Customized Subclass of JPanel JPanel Subclass that Handles Its Own Events Windows: Additional.
Graphics and Multimedia Part #2
DHTML: Structured Graphics ActiveX Control
COM148X1 Interactive Programming Lecture 6. Topics Today Generate Random Numbers Graphics Animation.
Introduction to Flash. Topics What is Flash? What can you do with it? Simple animation Complex interactive web application, such as an online store. Starting.
Formatting Text Word Lesson 4. Formatting Text Changing appearance of text Changing appearance of text Shape, size, type Shape, size, type On Home tab.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved CheckWriter Application Introducing Graphics and Printing.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
Chapter 15Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 15 l Basic Figures l Colors l Fonts and Other Text Details.
Drawing and Filling Geometric Shapes. Java comes with more than just points and lines. Within the Graphics2D class, there are also methods for drawing.
J McQuillan SE204: 2004/2005: Lecture 4slide 1 The Graphics Class Used when we need to draw to the screen Two graphics classes –Graphics –Graphics2D.
Graphics & Java 2D Drawing Two Dimensional Shapes Controlling Fonts Controlling Colors.
1 Chapter 3 2D Graphics: Rendering Details  Color spaces, paints stroke types  Affine transforms including translation, rotation, scaling, shearing,
1 Graphic Device Interface (GDI). 2 Class Form A Form is a representation of any window displayed in your application. The Form class can be used to create.
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.
Graphics and Java2D Chapter Java Coordinate System Origin is in _____________ corner –Behind title bar of window X values increase to the ________.
CPSC 217 T03 Week II Part #1: SimpleGraphics.py Hubert (Sathaporn) Hu.
1 Graphics, Fonts and Color Chapter 9. 2 What is in this chapter: l Graphics class and coordinates l graphics primitives (lines,rectangles,ovals and arcs)
Graphics and Multimedia. OUTLINE Font Control Drawing Lines, Rectangles and Ovals Drawing Arcs Drawing a General Path.
OV Copyright © 2012 Logical Operations, Inc. All rights reserved. Working with Vector Image Tools  Create Images with Vector Paths  Use the Shape.
Images Part 11 dbg. 2 Images The form and several controls can display a number of different types of image files in the BackgroundImage Property. These.
Java Enums Why have Choice.Yes and Choice.No?. Old Way  Enumerated types consist of a set of named values  Example: Font has BOLD, ITALIC rather than.
(PART III) Graphics and Multimedia 16/02/1437 Lect6 CT
GDI +. Graphics class's methods System.Drawing Graphics Objects.
Notes Microsoft PowerPoint. The basic unit of a PPT presentation.
10/20/2005week71 Graphics, mouse and mouse motion events, KeyEvent Agenda Classes in AWT for graphics Example java programs –Graphics –Mouse events –Mouse.
Graphics and Multimedia 2 Lecture 8. OUTLINE Font Control Drawing Lines, Rectangles and Ovals Drawing a General Path.
(PART II) Graphics and Multimedia 11/02/1437 Lect6 (Part 2)
12 Graphics and Java 2D™.
Basic Graphics Chapter 5 3/19/15 Thursday Section Only
Graphics Applets By Mr. Dave Clausen
Graphics and Multimedia
ThS. Nguyễn Hà Giang Khoa CNTT - Hutech
CASE Tools Graphical User Interface Programming Using C#
Graphics -- Introduction
Chapter Lessons Use the Macromedia Flash drawing tools
Inheritance.
Graphics and Multimedia
Plotting Multiple Graphs In The Same Plot
Extend Text Editor to Draw shapes
Signature: Microsoft Word 2003
Repetition and Multiple Forms
Graphics and Multimedia
Chapter 12 Graphics in Windows and the Web
Rectangle, x = 100, y = 200 Ellipse, x = 200, y = 300 #1.
CPT 450 Computer Graphics 3rd Lecture.
Presentation transcript:

(PART II) Graphics and Multimedia

Font Control Font s  After a Font is created, its properties cannot be modified  Programmers must create a new Font object to be different Font constructors  Must require a font name as an argument  They usually require the font size as an argument  And usually require the font style which is a member of the FontStyle enumeration: Bold, Italic, Regular, Strikeout, Underline. Graphics method DrawString sets the current drawing font—the font in which the text displays—to its Font argument.

Font Control DrawString constructors:  String to display  Font,  Brush  and the x- and y-coordinates of the location for the String’s first character. Example Dim textbrush As New SolidBrush(Color.Red) g.DrawString("Hello World", Me.Font, textbrush, 10, 10)

Example

Drawing Lines, Rectangles and Ovals Example: DrawRectangle(ByVal p As Pen, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer) FillRectangle(ByVal b As Brush, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer) Draw ShapeShape Outline Pen Solid Shape Brush

Drawing Lines, Rectangles and Ovals Ellipse bounded by a rectangle. height width (x, y)

Example