1 / 24

Multimedia

Multimedia. Graphics Animation Sound. Tip Of the Day. Tip of the Day: When using graphic methods at Form Load, the AutoRedraw property of the container object must be set to True. (Recall Test#3 - Student mark graph). Circle Method (Revisited). Me.Circle (x,y), radius.

Télécharger la présentation

Multimedia

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Multimedia Graphics Animation Sound

  2. Tip Of the Day • Tip of the Day: When using graphic methods at Form Load, the AutoRedraw property of the container object must be set to True. (Recall Test#3 - Student mark graph)

  3. Circle Method (Revisited) • Me.Circle (x,y), radius

  4. Circle Method (Arc) • Me.Circle (x,y), radius, , Start, End angle • Angle measure are in radians

  5. Circle Method (Pie Slice) • Me.Circle (x,y), radius, , -Start, -End angle • Start and End angles must be negative

  6. PaintPicture Method • The PaintPicture method is used to place an image in a certain location within a container • The syntax is as follows: • object.PaintPicture object2.Picture, x, y

  7. Cls Method • The Cls method is used to clear a container of all graphics drawn on it using the graphic methods. • The syntax is as follows: • object.Cls

  8. Using a Timer Object • The Timer method is used to execute code at specific time intervals. • A timer object ( ) can be used to simulate animation. • Properties: • Name • Interval • Enabled

  9. Timer Object Properties • Properties: • Name • Interval - is the amount of time (milliseconds) before the Timer event is executed. It can be changed at runtime. • Enabled - can be set to either True or False. When enabled is True, the Timer event will be called. When Enabled is False, The Timer event will not be called.

  10. Timer Event • The timer event occurs automatically after the amount of time specified in the Interval property. • After the code in the timer event procedure has been executed the timer object start counting down again.

  11. Example of Timer Private Sub Timer1_Timer() If Me.BackColor = vbBlue Then Me.BackColor = vbRed Else Me.BackColor = vbBlue End If End Sub

  12. Moving Line Program • This program uses the timer event to change the endpoint coordinates of the line randomly after the amount of time specified in the Interval property. • Moving Line Example

  13. Animation • Animation can be simulated by having several images on a form and then activating one image at a time. • For example, to animate a dolphin jumping, 3 pictures have been created at different points during the jump. • A timer object is used to control the speed of the animation.

  14. Animation - Dolphin Jump • The 3 pictures can be placed in a control array (Click to see)

  15. Animation - Control Array • A control array can be created by setting the Name property to the same value • For example: All 3 dolphin picture objects were named picDolphin and they were given index values 0, 1, 2 • picDolphin(0) • picDolphin(1) • picDolphin(2)

  16. Sound - Multimedia Object • A multimedia control can be used to add sound to an application. A multimedia object is created using the MMControl ( ) • To add the Multimedia component if it does not appear in your tool box, follow these steps:

  17. Sound - Multimedia Object • Step 1: Choose the Component from the Project menu.

  18. Sound - Multimedia Object • Step 2: Click here

  19. Sound - Multimedia Object • Properties: • Name • DeviceType - changes the type of device that is playing the sound. We will use .wav files, so the DeviceType is WaveAudio • Enabled - can be set to either True or False. True indicates the object can play sound. • FileName - used to select the file to be played • Visible - establishes whether you can see the object at runtime.

  20. Sound - Multimedia Commands • Commands: • Open - opens the mmcObjectready for playing • Close - closes mmcObject. A multimedia object should be closed before ending the application and must be closed before changing the FileName property. • Play - plays the sound track that was opened. • Stop - used to stop the file to being played • Prev - sets the sound track to its beginning.

  21. Sound - Multimedia Object • Syntax: mmcObject.Command = Command • Example of opening a multimedia object Private Sub Form_Load() mmcSound.DeviceType = "WaveAudio" mmcSound.FileName = "Laser.wav" mmcSound.Command = "Open" End Sub

  22. Sound - Multimedia Object • Syntax: mmcObject.Command = Command • Example of opening a multimedia objectPrivate Sub Form_Unload(Cancel as Integer) mmcSound.Command = "Close" End Sub

  23. Disco Dancer 2000 • Check it out!

  24. Summary • The following concepts were covered today: • Shape • Circles, Arcs and Pie Slices • Picture Box vs. Image Box • PaintPicture • Move Method • Animation • Sound

More Related