AGI STK Graphics 11 Send comments on this topic.
SetPixelOffsets Method (IAgStkGraphicsTextBatchPrimitiveOptionalParameters)
See Also  Example
PixelOffsets
An array containing a X and Y pixel offset for each string in the batch. There must be one X pixel offset followed by one Y pixel offset for each string passed to the Text Batch Primitive's Set or SetPartial method.





Description

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

Syntax

[Visual Basic .NET]
Public Sub SetPixelOffsets( _
   ByRef PixelOffsets As System.Array _
) 

[C#]
public void SetPixelOffsets(
ref System.Array PixelOffsets
);

[Managed C++]
public: void SetPixelOffsets(
System::Array ^^ PixelOffsets
);

[Java]
public  setPixelOffsets(
Object[] PixelOffsets
);

[Unmanaged C++]
public: HRESULT SetPixelOffsets(
SAFEARRAY ** PixelOffsets
);

Parameters

PixelOffsets
An array containing a X and Y pixel offset for each string in the batch. There must be one X pixel offset followed by one Y pixel offset for each string passed to the Text Batch Primitive's Set or SetPartial method.

Remarks

The pixel offset defines a screen-space translation for a string from its position. Positive x values translate to the right and positive y values translate up. This is commonly used when more than one primitive is located at the same position. For example, if a string in a text batch and a point in a point batch have the same position, the string may have a pixel offset applied to it so it doesn't overlap the point.

Per-string pixel offsets override the per-batch pixel offset. Therefore, when per-string pixel offsets are defined with this method, Pixel Offset is ignored.

Example

Shows the format of the PixelOffsets parameter when setting per string pixel offsets.
[C#] Copy Code
Array pixelOffset = new object[] 

    12
    21 
}; 
 
IAgStkGraphicsTextBatchPrimitiveOptionalParameters parameters = sceneManager.Initializers.TextBatchPrimitiveOptionalParameters.Initialize(); 
parameters.SetPixelOffsets(ref pixelOffset); 
 

Shows the format of the PixelOffsets parameter when setting per string pixel offsets.
[Visual Basic .NET] Copy Code
Dim pixelOffset As Array = New Object() {1, 2, 2, 1}

Dim parameters As IAgStkGraphicsTextBatchPrimitiveOptionalParameters = sceneManager.Initializers.TextBatchPrimitiveOptionalParameters.Initialize()
parameters.SetPixelOffsets(pixelOffset)

See Also

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1