English

How To: Change the background color of a view with Avenue

Summary

The sample script in this article will change the background color of a view.

Procedure

  1. Open a new script window.

    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.

  2. Copy the following code into the script window:

    Code:
    theView=av.GetActiveDoc
    aRasterFill=RasterFill.Make
    aRasterFill.SetColor(Color.GetBlue)
    theView.SetBackgroundSymbol(aRasterFILL)
    theView.Invalidate


    Note:
    To set the background color to a color other than blue, replace 'Blue' in the code "Color.GetBlue" with the color you want. For example, if you wanted the color to be red, the line of code would read "aRasterFill.SetColor(Color.GetRed)." Available default colors are black, blue, red, cyan, magenta, gray, green, yellow and white.

  3. Click the compile button.
    [O-Image] Script compile button

  4. Make the view active.
  5. Click the title bar of the script window.
  6. Click the run button.
    [O-Image] Run compiled script button