IMapColorCollection.Count

Syntax

Count: Integer;

Description

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

Example

Sub main;

Var

Metabase : IMetabase;

MetabaseObject: IMetabaseObject;

Report: IPrxReport;

Map : IMap;

BarVisual : IMapBarVisual;

Collection : IMapColorCollection;

Begin

Metabase := MetabaseClass.Active;

MetabaseObject := Metabase.ItemById("Report").Edit;

Report := MetabaseObject As IPrxReport;

Map := Report.ActiveSheet.Table.Objects.Item(0).Extension As IMap;

BarVisual := Map.Layers.FindByName("Regions").Visuals.Item(0) As IMapBarVisual;

Collection := BarVisual.Color.Values;

Collection.Count := 2;

Collection.Item(0) := GxColor.FromName("Red");

Collection.Item(1) := GxColor.FromName("Blue");

MetabaseObject.Save;

End Sub main;

After executing the example the specified set of colors is determined for the bar indicator fill. In this example, Report is an identifier of the regular report, which sheet contains the map.

See also:

IMapColorCollection