CST238 Week 6 Questions / Concerns? Announcements – HW#2 due next Monday (project concept/preliminary design) – Check-off Take Home lab#5 Comment about.

Slides:



Advertisements
Similar presentations
CST238 Week 8 Questions / Concerns? Announcements – Check-off Take Home lab#7 GUI Bloopers presentations (#5) New topics – Printing Richtext box Graphics.
Advertisements

About Links in Dreamweaver. Creating Links A link has 2 parts: –The URL (Uniform Resource Locator)= the name and path of the file you want to link –The.
User Interface Programming in C#: Graphics
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
© by Pearson Education, Inc. All Rights Reserved. continued …
Macromedia Flash MX 2004 – Design Professional and Interactivity WORKING WITH SYMBOLS.
Work with symbols and instances Work with Libraries Create buttons Assign actions to buttons Unit Lessons.
Chapter 13: Advanced GUI and Graphics
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
BoardMaker Ver 6 Creating Interactive Activities for the Classroom.
User Interface Programming in C#: Direct Manipulation Chris North CS 3724: HCI.
Graphics and Multimedia. Introduction The language contains many sophisticated drawing capabilities as part of namespace System.Drawing and the other.
VIDEOOPTIONS PIPE LIST PIPE INFO CAMERAS STATUS SLIDER.
Chapter 3 Working with Symbols and Interactivity.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface A Brief Introduction to GDI+ S.R.G. Fraser, Pro Visual C++/CLI.
CST238 Week 5 Questions / Concerns? Announcements – HW#1 due (Project ideas) – Check-off Take Home lab#4 Recap New topics – Drawing Coming up: – GUI Bloopers.
CST238 Week 7 Questions / Concerns? Announcements – HW#2 due today (project concept/preliminary design) – Check-off Take Home lab#6 Friday is the last.
Exercise : Animated Navigation Structure in Flash 1.Develop Answers to “What did you learn in ITI program?” “What do you have to offer?” “What are your.
Things to Know about PowerPoint How do I do this?.
Microsoft Office 2007 Word Chapter 1 Creating and Editing a Word Document.
BFTAW BDPA Workshop Introduction to GIMP Chris
BFTAW BDPA Workshop Introduction to GIMP Chris
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.
COMPUTER PROGRAMMING I Objective 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)
Lecture 4 Advanced Topics Devi, Erick, Reddy. » Declare dynamic component, an example: ˃Create a button Button newBtn = new Button(); ˃Create an array.
Animation and Double-Buffering. The animation methods described here are based on standard techniques of double-buffering applicable to most high-level.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
Visual Basic .NET BASICS
CST238 Week 4 Questions / Concerns? Announcements – Start thinking about project ideas – Test#1 next Monday, 4/28/14 Recap Check-off Take Home Lab#3 New.
Lab1 – Part III CSE 581 Roger Crawfis. To Do We have the basic framework, but need to: 1.Add the ability to open and read an image. 2.Generate pseudo-random.
KeyListener and Keyboard Events Another type of listener listens for keyboard entry – the KeyListener which generates KeyEvents –to implement KeyListener,
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
A Sample Visual Tutorial The next slide is a visual tutorial handout for describing how to “capture” an image. You could print out that single slide: File.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
Events with Data Arguments Data Values Travel with e.
The PictureBox Control Prefix Prefix – pic Image Property PictureBox Image Property – Changes the image or file that appears inside of the PictureBox SizeMode.
GDI+ 1. Objectives 2 GDI+ class  Create and render Graphic  Display information on the computer screen, printer 3.
BIM211 – Visual Programming Interacting with Users Graphics 1.
User Interface Programming in C#: Direct Manipulation Chris North CS 3724: HCI.
Chapter 2 – Introduction to the Visual Studio .NET IDE
PowerPoint Basics Tutorial 1: Objects These tutorials will introduce you to the most basic and useful functions of Microsoft PowerPoint We’re going.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
Lab 11: Animation User Interface Lab: GUI Lab Nov. 6 th, 2013.
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
Making Billboards By Deborah Nelson Duke University, Under the direction of Professor Susan Rodger, July 14, 2008.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
Macromedia Flash Design Professional And Interactivity WORKING WITH SYMBOLS.
Hyperstudio: A Beginner’s Tutorial By Judy Swaim.
Slide 1 VB Graphics Controls & Timer Control. Slide 2 Default Controls.
Tutorial 7 Creating Animations. XP Objectives Learn about animation Create a timeline Add AP divs and graphics to a timeline Move and resize animation.
Resources & Bitmaps Adding clip art to your application.
Fall UI Design and Implementation1 Lecture 13: Animation.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
PowerPoint Basics Tutorial 2: A Slide Show In this tutorial you’re going to create a presentation from scratch. You will have to keep this presentation.
DM 11- Flash –Unit C and Interactivity WORKING WITH SYMBOLS.
Enhancing JavaScript Using Application Programming Interfaces (APIs), Lecture #3.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Graphics and Multimedia
Event Driven Programming
INTRODUCTION TO ADOBE FLASH CS4
Using Cascading Style Sheets (CSS)
Chapter 4 Enhancing the Graphical User Interface
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

CST238 Week 6 Questions / Concerns? Announcements – HW#2 due next Monday (project concept/preliminary design) – Check-off Take Home lab#5 Comment about Test#1 New topics – Drawing & Animation GUI Bloopers presentations (#1&#2) Coming up: – GUI Presentation #3 & #4 next Monday – Data Binding & Data Views Take Home Lab#6

Drawing You need the Graphics class from System.Drawing namespace. Two ways to get a Graphics object – Create a new that’s associated with the form or control – Grab the Graphics object in the Paint event’s PaintEventArgs

Drawing There are 2 types of draw: – Immediate Draw Not updated after form resize, covered or uncovered. – Redraw Updated each time a form is updated. This is done through Paint event. This event can be triggered using Invalidate

Drawing Two useful properties: – ResizeRedraw = true; – DoubleBuffered = true; //reduce flickering

Keyboard Movement Attach key events to the form to move drawings around. Keys.Up / Keys.Down / Keys.Left / Keys.Right are 4 common movement keys. x, y

Adjust (x,y) with each key movement Re-paint the image at new (x,y) with each key movement. Make sure that the drawing has key focus. – Try adding a button x, y

Adding Animation Instead of adjusting (x,y) with key events, how about having it adjusted every timer tick? Adding a timer. In Timer’s Tick event, adjust (x,y) accordingly. Re-paint the image at new (x,y) with timer tick. Check for boundary conditions so drawing doesn’t go outside the form.

Start & Stop Animations You can start or stop animation by Start or Stop the timer. Start / Stop can be linked to a key or a button. Timer1.Start(); Timer1.Stop();

Image Transparency Bitmap dog = new Bitmap("dexter.bmp"); //file dexter.bmp is in debug directory. //it has blue background dog.MakeTransparent(Color.Blue); Rectangle dogRect = new Rectangle(x, y, 75, 75); g.DrawImage(dog, dogRect);

Animation Example

Animation: Moving Multiple Objects Timer triggered animation: – Adjust as many (x, y) with each Tick event. – Make sure DoubleBuffered and ResizeRedraw are set to true; – Re-paint the entire form after each Tick event.

Animation: Manual Movement Sometimes you might want to manually move an object on the screen independent of timer and Paint events. For example: In a sorting algorithm, instead of just showing result of sort, I want to show elements being swapped.

Animation: Manual Movement Instead of using timer, call System.Threading.Thread.Sleep(ms); Manually drawing and erasing objects on the screen. The movement animation is not permanent so it’s not done in Paint event.

Form Vs. Panel vs. Picturebox Setting DoubleBuffered to true on the form will reduce the flickering. But if drawings are made inside a panel or picturebox, the DoubleBuffered on the form doesn’t take care of it. You need to create a custom Panel or Picturebox. Two options: – Draw on the form and have form’s DoubleBuffered take care of it. – Create a derived control and set its DoubleBuffered.

Take Home Lab #6 Draw some objects and show animation. Allow the user to start and stop animation Try to experiment with moving more than one object at a time. Try to do manual animation movement as well as using timer/Paint event. Reduce flicker when appropriate. Enable the user to resize the form and redraw accordingly.