Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging, Sound, and Graphics.

Slides:



Advertisements
Similar presentations
Windows Basics An Introduction to the Windows Operating System.
Advertisements

RAPTOR Syntax and Semantics By Lt Col Schorsch
FINAL REVIEW Carley. Contents Unit A: Understanding Essential Computer Concepts Unit B: Getting Started wit Mac OS X Leopard Unit C: Understanding File.
Mark Dixon, SoCCE SOFT 131Page 1 22 – Visual BASIC 2005.
Mark Dixon, SoCCE SOFT 136Page 1 05 – Conditional Execution.
Mark Dixon, SoCCE SOFT 136Page 1 02 – Software Development Life-Cycle.
Mark Dixon Page 1 05 – Conditional Execution. Mark Dixon Page 2 Admin: Test (next week) In class test –teaching week 6 50 minutes short answer (5 - 6.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon, SoCCE SOFT 131Page 1 SOFT – Module Introduction & Overview.
Mark Dixon, SoCCE SOFT 131Page 1 20 – Web applications: HTML and Client-side code.
Mark Dixon, SoCCE SOFT 131Page 1 03 – User Interface Design, and Sound and Graphics.
Mark Dixon Page 1 02 – Dynamic HTML (client-side scripting)
Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging & Graphics.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Software Development Lifecycle, & User Interface Design.
Mark Dixon, SoCCE SOFT 131Page 1 05 – Conditional Execution.
Slide 1 ICS 012 Visual Programming I Ahmed Esmat Second.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Conditional Execution.
Mark Dixon, SoCCE SOFT 131Page 1 13 – Control Arrays & Container Controls.
Introduction to Visual Basic What it is, and a simple program Mike Thelwall University of Wolverhampton, UK.
Mark Dixon, SoCCE SOFT 131Page 1 11 – Arrays of Structures & Modules.
Mark Dixon, SoCCE SOFT 131Page 1 SOFT – Module Introduction & Overview.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Software Development Lifecycle, & User Interface Design.
Mark Dixon, SoCCE SOFT 131Page 1 05 – Information Processing: Data-types, Variables, Operators & Functions.
Mark Dixon, SoCCE SOFT 131Page 1 08 – Web applications: HTML and ActiveX controls.
Chapter 11 Adding Media and Interactivity. Flash is a software program that allows you to create low-bandwidth, high-quality animations and interactive.
Prepared by George Holt Digital Photography BITMAP GRAPHIC ESSENTIALS.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Chapter 3 Working with Symbols and Interactivity.
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
MULTIMEDIA What is Multimedia? The word MULTIMEDIA is made up from two words, MULTI meaning more than one and MEDIA meaning a way of displaying or passing.
02 – Client-side code: JavaScript
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.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Appendices A - F A-F Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
Working with Symbols and Interactivity
M Dixon 1 04 – Data Types & Debugging. Questions: Expressions a)What is the result of: 7 + Int(8.245) b)Write an expression to: put a random number into.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Mark Dixon 1 05 – Conditional Execution. Mark Dixon 2 Admin: Test (next week) In class test –teaching week 6 50 minutes short answer (5 - 6 words) currently.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
Mark Dixon 1 11 – Array Variables. Mark Dixon 2 Questions: Loops What is the value of t, after this code executes? t = 0 For x = 4 To 6 t = t + x Next.
Mark Dixon, SoCCE SOFT 136Page 1 SOFT – Module Introduction & Overview.
Mark Dixon, SoCCE SOFT 131Page 1 05 – Variables. Mark Dixon, SoCCE SOFT 131Page 2 Admin: Test (next week) In class test –teaching week 6 –university week.
Chapter Two Creating a First Project in Visual Basic.
Mark Dixon Page 1 03 – Dynamic HTML (client-side scripting)
M Dixon 1 03 – Dynamic HTML (client-side scripting)
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
Standard Grade Programming using VB 1 Programming Visual Basic.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Mark Dixon, SoCCE SOFT 131Page 1 16 – Visual BASIC 6.0.
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon 1 9 – Case Study. Mark Dixon 2 Session Aims and Objectives Aims –To give an overview of the development of a web-page from initial idea to.
VB Objects & Events (Exercises) School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Friday 1/31/2003)
Mark Dixon Page 1 04 – Conditional Execution. Mark Dixon Page 2 Questions: Expressions a)What is the result of: 10 * Int( ) b)How many functions.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
Mark Dixon Page 1 03 – Information Processing: Expressions, Operators & Functions.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
An Introduction to Computers and Visual Basic
An Introduction to Computers and Visual Basic
Visual Basic.
Working with Symbols and Interactivity
Windows file management
An Introduction to Computers and Visual Basic
Chapter 4 Enhancing the Graphical User Interface
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging, Sound, and Graphics

Mark Dixon, SoCCE SOFT 131Page 2 Session Aims & Objectives Aims –introduce you to the fundamentals of: debugging sound, and graphics Objectives, by end of this week’s sessions, you should be able to: –identify & correct simple errors in your applications –put bitmap (raster) graphics into your applications –draw simple vector graphics in your applications –play MP3 and WAV files in your applications

Mark Dixon, SoCCE SOFT 131Page 3 Testing & Debugging: Errors 3 error types : –syntax: computer unable to understand your instructions (program does not execute), e.g. variable not defined (probably most common) –run-time: program can't execute instruction and exits (future lecture) Device unavailable (e.g. floppy drive) –logical: program executes but does not not match specification (do what was intended), e.g. clicking on button does nothing, when you thought you attached code to it clicking on blue button changes colour to red (when it should change to blue)

Mark Dixon, SoCCE SOFT 131Page 4 Computer –just symbol matching –No intelligence Example: Hello Errors Sub Command1_Cluck LabelL.Caption = "Hello" End Sub L instead of 1: causes syntax error (variable not defined) u instead of i: causes logical error (Command1 button does nothing)

Mark Dixon, SoCCE SOFT 131Page 5 Exercise: Errors The following example is from lecture 1, –Spot the errors (you should find 6), and –decide whether they are syntax or logical Private Sub btnBlue_Cluck() lblResult.BackColor = vbRed End Sub Private Sub btnRed_lick() lblResult.BackColor vbRed End Sub Private Sub lb1Result_DblClick() lblResult.BackColour = vbWhite End Sub

Mark Dixon, SoCCE SOFT 131Page 6 Debugging: Testing Functional Decomposition –break it into logical chunks Incremental Development –type a bit –test it Testing –test all/most combinations Regression Testing –repeat all previous tests

Mark Dixon, SoCCE SOFT 131Page 7 Types of Graphics: Raster Raster graphics – made of dots (pixels – picture elements) –stored in.jpg,.bmp, and.gif files –suitable for complex, static pictures (e.g. photos) –difficult to change programmatically –loses quality when enlarged:

Mark Dixon, SoCCE SOFT 131Page 8 Types of Graphics: Vector Vector graphics – made of objects (lines, circles, etc.) –suitable for simple, dynamic pictures (diagrams) –No loss of quality when enlarged

Mark Dixon, SoCCE SOFT 131Page 9 Example: PicView - Analysis SPECIFICATION User Requirements –display photos quickly and easily one after another Software Requirements –Functional: –change current folder and drive –display list of picture files in current folder –display picture (*.jpg, *.bmp, and *.gif) from files in current folder –Non-functional should be quick and easy to use PicView

Mark Dixon, SoCCE SOFT 131Page 10 Controls Picture Box: display pictures Drive List Box: allow user to select disk drive Directory List Box: allow user to select folder File List Box: allow user to select file

Mark Dixon, SoCCE SOFT 131Page 11 Controls' Properties Picture Box (pic) –Picture: allows display of bitmap (raster graphic) as background Drive List Box (drv) –Drive: the currently selected disk drive Directory List Box (dir) –Path: the currently selected directory (folder) File List Box (fil) –Path: the currently selected folder/directory –Pattern: only display this type of file (e.g..jpg) –FileName: the currently selected file

Mark Dixon, SoCCE SOFT 131Page 12 Example: PicView - Design User interface design: Functional design: Trigger (when)Actions (what) click event of Drive Boxmake drive current (directory box points to this drive) click event of Directory Boxmake folder current (file box points to this folder) click event of File Boxdisplay selected picture in picture box

Mark Dixon, SoCCE SOFT 131Page 13 Example: PicView - Code Option Explicit Private Sub drvMain_Change () dirMain.Path = drvMain.Drive End Sub Private Sub dirMain_Change () filMain.Path = dirMain.Path End Sub Private Sub filMain_Click () picMain.Picture = LoadPicture(filMain.Path & "\" & filMain.FileName) End Sub drvMain dirMain picMain filMain

Mark Dixon, SoCCE SOFT 131Page 14 Vector Graphics: Grid System the origin (position 0,0) is at top left –in mathematics it is always bottom left

Mark Dixon, SoCCE SOFT 131Page 15 Picture Box: Drawing Methods Methods (vector graphics) –Line: draws a straight line between 2 points –Circle: draws a circle –PSet: draws a dot (point) –Cls: clears (screen) drawing area

Mark Dixon, SoCCE SOFT 131Page 16 Example: Shapes Form and Picture Box control support graphics methods: picDisplayArea.Line (500, 200)-(1900, 800) picDisplayArea.Line -(2600, 600) picDisplayArea.Line -Step(-600, -400) picDisplayArea.PSet (1500, 1000) picDisplayArea.Circle (700, 900), 300 Shapes

Mark Dixon, SoCCE SOFT 131Page 17 Example: StickMan Enabled property (true or false) StickMan

Mark Dixon, SoCCE SOFT 131Page 18 Example: Face Face

Mark Dixon, SoCCE SOFT 131Page 19 Example: Music Player - Analysis User Requirement: –to play different music for long time without interruption, at same location (while working or at party) Software Requirements Specification software should: –allow user to: select track (MP3 file) from folder on disk play selected track –automatically move to next track in folder go back to first after last has played later lecture

Mark Dixon, SoCCE SOFT 131Page 20 Additional Controls VB has hundreds of controls To include additional controls in your project: –Project menu –Components item Multimedia Control –plays MP3 & WAV files

Mark Dixon, SoCCE SOFT 131Page 21 Multimedia Controls' Properties Multi-media Control –FileName: name of file to play –Command: controls playback

Mark Dixon, SoCCE SOFT 131Page 22 Example: Music Player - Design Compare the following User Interface Designs: V0 V1

Mark Dixon, SoCCE SOFT 131Page 23 Example: Music Player - Code Option Explicit Private Sub drvMain_Change() dirMain.Path = drvMain.Drive End Sub Private Sub dirMain_Change() filMain.Path = dirMain.Path End Sub Private Sub filMain_Click() mmcMain.Command = "Close" mmcMain.FileName = filMain.Path & "\" & filMain.FileName mmcMain.Command = "Open" End Sub drvMaindirMain filMainmmcMain