## Getting Started

This section contains the following topics.

- What is DirectAnimation?
- Who Should Use DirectAnimation?
- What Do You Need to Use DirectAnimation?
- How Can You Use DirectAnimation?
- The DirectAnimation Samples
- Documentation Roadmap

### What is DirectAnimation?

Microsoft® DirectX® media is a family of high-level APIs and multimedia controls that provide rich support for animation, streaming, and integration of the different media types. Microsoft DirectAnimation™ is the DirectX media component that creates Web animation and integrates dynamic HTML.

DirectAnimation is a COM API and an underlying run time that different users can access in different ways. HTML authors can add multimedia and animation to their pages by using the DirectAnimation controls, without programming at all. You can also animate HTML pages by using Microsoft Visual Basic® Scripting Edition (VBScript), JScript and Java applets. Finally, Java, Visual Basic, and C++ application programmers can develop ActiveX™ Controls or full applications. Thus, DirectAnimation provides multimedia tools that scale from the HTML author to the C++ programmer.

The DirectAnimation SDK provides documentation, samples, and tutorials to help users get started with DirectAnimation.

You can implement DirectAnimation by using the DirectX foundation API and DirectShow™. For a guide on where to find out about particular DirectShow features, see the DirectShow Documentation. For more information about the DirectX foundation components, see http://www.microsoft.com/DirectX/.

Key features of the DirectAnimation API are:

- Comprehensive support for different media types. 2-D vector graphics, images and sprites, 3-D geometry, video, and sound (including MIDI) are unified in a single animation API.
- A uniform time and event model that simplifies temporal coordination and interaction of the different media types. This model frees users from frame-level details and provides the foundation for supporting inherently time-based media types such as video and audio.

DirectAnimation provides services that make it easy to build high-performance animation in a variety of environments, such as HTML, VBScript and JScript, Java, and Microsoft Visual C++®. Components include controls for HTML environments and a COM-based animation library accessible from any programming or scripting language.

A set of multimedia run-time controls supply scripting access to some of the DirectAnimation API functions and libraries. The Path, Sequencer, Sprite, and Structured Graphics controls enable you to deliver impressive animation, image, and sound content over the Web with very little code. See DirectAnimation Multimedia Controls for a description of the controls and how to use them. Or see samples to view the control samples.

The following diagram shows the DirectAnimation architecture. The ActiveMovie Control provides an interface to some of the DirectShow API functions. The multimedia controls provide an interface to some of the DirectAnimation library. You can also access the library directly. The DirectAnimation library, in turn, uses the DirectShow API, the DirectX foundation, and certain operating-system services. SG stands for Structured Graphics control and Seq stands for the Sequencer control.

### Who Should Use DirectAnimation?

Like other system services such as window management or client/server frameworks, DirectAnimation's functionality supports a number of applications. This documentation focuses on Internet applications.

The multimedia authoring community includes people skilled in a variety of disciplines. From graphics system programmers to creative professionals, Web developers come from many backgrounds and bring as many approaches to the task of producing multimedia for the Web.

Web multimedia developers can be grouped by the tools they use:

Developer | Tools
Creative professional | Painting software, scanners, cameras, image editing software, sound editors
Web site builder | Authoring tools for HTML (Microsoft FrontPage®, for example)
Script writer | JScript, VBScript, HTML source
Application developer | C, C++, Visual Basic, Java, SQL, Active Server, CGI scripts
Graphics systems programmer | Low-level languages (C, C++) and graphics APIs

DirectAnimation serves each of these developers. The multimedia client controls are the quickest approach for common applications, such as sprite sequences or line drawing. The scripting interface for JScript and VBScript adds many animation features in a simple, high-level way. Finally, you can use Java or C++ (or any other COM-enabled language) to access the media and animation library with the full power of an object-oriented, compiled language.

The following table shows the typical ways different developers would access DirectAnimation.

Developer | Accesses DirectAnimation through...
Creative professional | DirectAnimation controls
Web site builder | DirectAnimation controls, DirectAnimation scripting
Script writer | DirectAnimation scripting, DirectAnimation for Java
Application developer | DirectAnimation for Java, DirectAnimation scripting, and C++
Graphics systems programmer | DirectAnimation through native COM, C++, DirectX foundation, and DirectShow

### What Do You Need to Use DirectAnimation?

Internet Explorer 4.x contains all the software necessary to view multimedia created with DirectAnimation.

The following list shows what you need to create presentations with DirectAnimation:

- The DirectAnimation run-time library, which is part of the Internet Explorer 4.x minimal install.
- The DirectAnimation SDK, which includes samples in JScript, VBScript, Java, and Visual Basic.
- JScript and VBScript users need only Internet Explorer 4.x to develop animations.
- Visual Basic, Java, and C++ users need the Microsoft Visual Basic, Microsoft Visual J++®, or Microsoft Visual C++ version 5.x environments or their equivalents. You can also use the DirectAnimation API from VBScript and JScript without compiling.

### How Can You Use DirectAnimation?

You can use DirectAnimation in the following ways:

- As an inline, HTML Web animation through JScript, VBScript, or the DirectAnimation controls.
- As a Web animation in the form of a Java applet.
- As a stand-alone application or an ActiveX™ Control implemented through Java, Visual Basic, or C++.
- To construct animated windowless controls.
- To animate properties of ActiveX Controls.
- To load animations asynchronously and hide the load time.

You can access DirectAnimation from JScript, VBScript, Visual Basic, and C++ through the scripting (COM) interfaces directly. Or, you can add DirectAnimation content to your Web pages by using the DirectAnimation controls and setting parameters on these controls; that is, without programming at all. See the DirectAnimation Controls section for more details. Using the DirectAnimation controls directly, or using JScript or VBScript, enables you to describe inline animations with HTML. Such animations can integrate with Dynamic HTML by being windowless on the page (overlaying other elements such as text) or by driving the properties of other entities on the page. You can also import HTML-rendered text and use it as a texture in an animation.

There is a special Java binding for DirectAnimation provided on top of the COM API that takes advantage of specific Java features. For example, operations are overloaded, so that several COM methods that perform similar functions but use different parameter types are given the same name in Java.

### The DirectAnimation Samples

The DirectAnimation SDK includes a wide variety of samples to illustrate using DirectAnimation from the different host languages. For each host language there are four categories of samples, as follows:

- Exercises: Illustrate the most basic use of DirectAnimation.
- Templates: Provide code that implements common DirectAnimation tasks.
- Showcases: Demonstrate the breadth of features in the system. Some of them have real-life applications, such as advertising or education.
- Tutorials: Explain step-by-step details of how to construct some Java samples. These samples include a button labeled Info on the main HTML page that launches a new instance of the browser containing the tutorial, so that you can see the narration side-by-side with the running animation.

### Documentation Roadmap

The DirectAnimation documentation is divided into several sections. To help you find the information you need, the following list describes the content of each section and when you will typically use it. For the most recent updates to this documentation, consult the Microsoft DirectX Web site at http://www.microsoft.com/DirectX/.

- Getting Started — contains general information about DirectAnimation. Use this section to orient yourself when first starting with DirectAnimation.
- Guide to Samples — contains a description of the templates, exercises, and showcase samples included with DirectAnimation. When viewing the documents as HTML, you can link directly to each sample described. This section also includes step-by-step procedures describing how to write simple JScript, VBScript, and Java code.
- Scripting Cookbook — contains basic examples of animation features in JScript, suitable for cutting and pasting.
- DirectAnimation Controls — contains articles about the DirectAnimation multimedia controls, as well as wizards that allow you to experiment with the controls.
- Programmer's Guide — contains overview articles covering basic DirectAnimation concepts such as coordinate systems, timelines, and events, plus a detailed discussion of behaviors and media types.
- DirectAnimation Scripting Reference — contains descriptions of the interfaces and methods used by JScript, VBScript, Visual Basic, and C++ users.
- DirectAnimation Java Reference — contains descriptions of the DirectAnimation Java classes and interfaces and their methods, event data, a list of default values, and a hierarchy chart.
- Glossary — contains definitions of basic animation terms and DirectAnimation terms.

The DirectAnimation documentation does not include material on how to program in Java, C/C++, or Visual Basic. Consult the appropriate programming documentation for this information.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.