## I

image
  Images are 2-D. They have width and height, but no depth. Images are objects of the DAImage (or Java ImageBvr) class type, and can be operated on by methods, such as DAImage.Crop (or Java ImageBvr.crop), DAImage.Tile (or Java ImageBvr.tile), and DAImage.Transform (or Java ImageBvr.transform).

  You can import images into DirectAnimation from a URL or local file. DirectAnimation supports .png, .jpg, .gif, and .bmp formats. Importing is done in two steps: first you construct your URL base, then you use the ImportImage function (or Java importImage method), as shown in the following Java example:

         //Create a URL base
         URL imageBase = buildURL(getImportBase(),"file:/c:/DxM/Media/image/");
         // Create an image behavior by importing an image file
          ImageBvr img = importImage(buildURL(imageBase, "square.jpg"));

  The following example shows how to import an image from a local file, using JScript:

        mediaBase = "..\\..\\..\\..\\media\\";
        // the following form will also work as well
        // mediaBase = "file://c:\\dxm\\media\\";

        imageBase = mediaBase + "image\\";
        myImage = m.ImportImage(imageBase + "foliageUtah.jpg");

  The following example shows how to import an image from over the Internet, using JScript:

        mediaBase = "http://dxmedia/directanimation/dxm_sdk/media/";
        imageBase = mediaBase + "image/";
        myImage = m.ImportImage(imageBase + "foliageUtah.jpg");

  You can also construct an image by rendering lines, text, or geometries. See Using Images for more information.

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