IMapColorCollection.Count

Syntax

Count: Integer;

Description

The Count property determines the number of colors in the collection.

Example

Executing the example requires a regular report with the REPORT identifier with a map on the report sheet.

Add links to the Drawing, Map, Metabase, Report, and Tab system assemblies.

Sub UserProc;
Var
    Metabase : IMetabase;
    MetabaseObject: IMetabaseObject;
    Report: IPrxReport;
    Sheets: IPrxSheets;
    SheetT : IPrxTable;
    Map : IMap;
    BarVisual : IMapBarVisual;
    Collection : IMapColorCollection;
Begin
    Metabase := MetabaseClass.Active;
    MetabaseObject := Metabase.ItemById("REPORT").Edit;
    Report := MetabaseObject As IPrxReport;
    Sheets := PrxReport.ActiveReport.Sheets;
    SheetT := Sheets.Item(0As  IPrxTable;
    Map := SheetT.TabSheet.Objects.Item(0).Extension As IMap;
    BarVisual := Map.Layers.FindByName("Regions").Visuals.Item(0As IMapBarVisual;
    Collection := BarVisual.Color.Values;
    Collection.Count := 2;
    Collection.Item(0) := GxColor.FromName("Red");
    Collection.Item(1) := GxColor.FromName("Blue");
    MetabaseObject.Save;
End Sub UserProc;

After executing the example the specified set of colors is determined for the bar indicator fill.

See also:

IMapColorCollection