COMPUTER PROGRAMMING I Objective 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)

Slides:



Advertisements
Similar presentations
Chapter 9 Color, Sound and Graphics
Advertisements

COMPUTER PROGRAMMING I Objective 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Eight Sub and Function Procedures.
Making a cartoon or slideshow. Aside VB comments An apostrophe starts a comment to end of line Some of the following slides have code with comments in.
Lecture Roger Sutton CO331 Visual Programming 16: Timer Control 1.
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Visual Basic Project Files:.VBP file: Project File: a small text file that contains the names of other files in the project, as well as some information.
Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones.
PictureBox, Timer, Resources. Resources An easy and effective way to add pictures (photos, graphics) to your programs Using Resources guarantees that.
Apply Sub Procedures/Methods and User Defined Functions
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
CS0004: Introduction to Programming Variables – Numbers.
1 Graphical User Interfaces Part 2 Outline Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface A Brief Introduction to GDI+ S.R.G. Fraser, Pro Visual C++/CLI.
1 Chapter 9 – Additional Controls and Objects 9.1 List Boxes and Combo Boxes 9.2 Eight Additional Controls and Objects 9.3 Multiple-Form Objects 9.4 Graphics.
Multimedia ! Graphics ! Animation ! Sound Tip Of the Day 4 Tip of the Day: When using graphic methods at Form Load, the AutoRedraw property of the container.
Multiple Forms and Standard Modules
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Lecture 4 Advanced Topics Devi, Erick, Reddy. » Declare dynamic component, an example: ˃Create a button Button newBtn = new Button(); ˃Create an array.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter 9 - VB.Net by Schneider1 Chapter 9 – Additional Controls and Objects 9.1 List Boxes, Combo Boxes, and the File-Opening Control The List Box Control.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Introduction to Visual Basic.NET Your First Visual Basic.NET Application.
Chapter 6 Sub Procedures
Timer, Animation Responding to Mouse & Keyboard Lab 7 7 McGraw-Hill© 2006 The McGraw-Hill Companies, Inc. All rights reserved.
VB.NET Additional Topics
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Some graphics. Projects included A slideshow a dark moon moving phases of the moon billiards Your own icons and bitmaps Pie chart.
The PictureBox Control Prefix Prefix – pic Image Property PictureBox Image Property – Changes the image or file that appears inside of the PictureBox SizeMode.
1 Week 6 The Repetition Structure. 2 The Repetition Structure (Looping) Lesson A Objectives After completing this lesson, you will be able to:  Code.
Statements That Repeat. For...Next Loop Structure For counter = start To end Step increment statements Next counter Where Counter is tested to see if.
Tutorial 6 The Repetition Structure
COMPUTER PROGRAMMING I SUMMER 2011 Objective 8.02 Apply Procedures to Create Picture Boxes using Images. (5%)
6c – Function Procedures Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
CS 101 Test 2 Study Guide Acronyms RAD - Rapid Application Development IDE - Integrated Development Environment GUI - Graphical User Interface VB - Visual.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface Creating a Multiple-Form Interface.
16.9 Introduction to Multimedia Visual Basic offers many convenient ways to include images and animations in programs Computing field decades ago mainly.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Slide 1 VB Graphics Controls & Timer Control. Slide 2 Default Controls.
Lab 10 Slides.
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
Practical Programming COMP153-08S Lecture: Repetition.
Week 1 Lecture 1 Slide 1 CP2028 Visual Basic Programming 2 “The VB Team” Copyright © University of Wolverhampton CP2028 Visual Basic Programming 2 v Week.
COM148X1 Interactive Programming Lecture 8. Topics Today Review.
Computer Science Up Down Controls, Decisions and Random Numbers.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
Use TryParse to Validate User Input
Chapter 1: An Introduction to Visual Basic .NET
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Computing with C# and the .NET Framework
Apply Procedures to Develop Message, Input, and Dialog Boxes
Use TryParse to Validate User Input
Objective 8.02 Apply Procedures to Create Picture Boxes using Images.
Computer Programming I
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Chapter 6 Sub Procedures
Simple Windows Applications
Chapter 8 - Functions and Functionality
CIS 338: Images on Forms Dr. Ralph D. Westfall May, 2009.
Chapter 12 Graphics in Windows and the Web
GUI Programming in Visual Studio .NET
Presentation transcript:

COMPUTER PROGRAMMING I Objective 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)

Objective/Essential Standard Essential Standard 8.00 Apply procedures to develop graphics applications Indicator 8.03 Apply Animation and Graphic Methods in a Windows Form (4%)

The Timer Control You can add a Timer control to your module and use it to “animate” your picture. A timer generates recurring events.  Code inside the timer event will recur until the timer is stopped. The Timer is located in the Components area of your Toolbox. Click on it, then click on your form. The Timer will display in your Component Tray.

Using the Timer Control Timer1 in the Component Tray Timer Properties

Timer Control Timer PropertiesDescription (Name)The name of a timer should start with tmr EnabledTrue if the timer can respond to user interaction, otherwise false (default) IntervalThe interval sets the time in milliseconds between elapsed events = 1 second Timer EventDescription StartStarts by raising the Elapsed event by setting Enabled to True StopStops by raising the Elapsed event by setting Enabled to False

Using the Timer Control To set the timer interval at runtime. tmrName.Interval = number in milliseconds  Example: tmr2Secs.Interval = 2000 To enable/disable the timer at runtime. tmrName.Enabled = True/False  Example tmr2Secs.Enabled = True

Using the Timer Control To create an event for the timer, create a Tick event.  Double Click on the Timer control  Type the code The code that is to repeat goes in the timer tick event. To start the timer timer1.Start() To stop the timer timer1.Stop()

PictureBox & Timer Example Private Sub tmrChange_Tick(ByVal sender As Object, ByVal e As _ System.EventArgs) Handles tmrChangeTick Const MAX_IMAGES As Integer = 3 Static ImageNum as Integer = 0‘use Static to hold the value. Select Case ImageNum Case 0 Me.picImage.Image = My.Resources.fish Case 1 Me.picImage.Image = My.Resources.star Case 2 Me.picImage.Image = My.Resources.moon ImageNum = (ImageNum + 1) Mod intMAXIMAGES 'determine next image number End Sub