Question: Can I "measure" a string to let me center it at a lat/long?

I'm displaying a symbol using AddMilStd2525Symbol and would like to center a text label beneath it. It looks like the offset values are offsets from the lat/long.

Is there a method similar to MeasureString that I can use to calculate what my offsets would be to get the string centered (horizontally) at the lat/long?

Here's my code snippet:

layer.AddMilStd2525Symbol(layer_handle, latitude, longitude, imagePath);

layer.AddText(layer_handle, latitude, longitude, targetName, 0, 15);

Environment

FalconView Version: FalconView 4.0.1
Interface: ILayerEditor
Language: Visual C++

(EDIT ICON)

-- CraigEddy - 07 Mar 2008

Answer

You can use the Win32 API method GetTextExtentPoint32 after selecting the appropriate font into the device context.