AGI STK Graphics 11Send comments on this topic.
SetColors Method (IAgStkGraphicsTextBatchPrimitiveOptionalParameters)
See Also  Example
Colors
An array containing the numeric representation of a color for each string in the batch. There must be one color for each string passed to the Text Batch Primitive's Set or SetPartial method. In .NET a Color should be translated a number by calling its ToArgb method and casting the result as an unsigned integer.
Windows






Windows & Linux

Description

Defines a collection of colors, one for each string in the batch.

Syntax

[Visual Basic .NET]
Public Sub SetColors( _
   ByRef Colors As System.Array _
) 
[C#]
public void SetColors(
   ref System.Array Colors
);
[Managed C++]
public: void SetColors(
   System::Array ^^ Colors
);
[Java]
public  setColors(
   Object[] Colors
);
[Unmanaged C++]
public: HRESULT SetColors(
   SAFEARRAY ** Colors
);

Parameters

Colors
An array containing the numeric representation of a color for each string in the batch. There must be one color for each string passed to the Text Batch Primitive's Set or SetPartial method. In .NET a Color should be translated a number by calling its ToArgb method and casting the result as an unsigned integer.

Remarks

Per-string colors override the per-batch color. Therefore, when per-string colors are defined with this method, the text batch's Color property is ignored.

Example

Shows the format of the Colors parameter when setting per string colors.
[C#]Copy Code
Array colors = new object[] 

    Color.Red.ToArgb(), 
    Color.Green.ToArgb(), 
    Color.Blue.ToArgb(), 
    Color.White.ToArgb() 
}; 
 
IAgStkGraphicsTextBatchPrimitiveOptionalParameters parameters = sceneManager.Initializers.TextBatchPrimitiveOptionalParameters.Initialize(); 
parameters.SetColors(ref colors); 
 

Shows the format of the Colors parameter when setting per string colors.
[Visual Basic .NET]Copy Code
Dim colors As Array = New Object() {Color.Red.ToArgb(), Color.Green.ToArgb(), Color.Blue.ToArgb(), Color.White.ToArgb()}

Dim parameters As IAgStkGraphicsTextBatchPrimitiveOptionalParameters = sceneManager.Initializers.TextBatchPrimitiveOptionalParameters.Initialize()
parameters.SetColors(colors)

See Also

© 2018 Analytical Graphics, Inc. All Rights Reserved.