DrawImageLabel

Activates an interactive mode for drawing an image label in the 3D World. The drawing process and style can be controlled using the related drawing events: OnDrawingAbort, OnDrawingFinished, and OnDrawingGeometryChanged. The ITerrainLabel return object can be used to set any of the properties of the drawn label.

Note:    The Position of the returning  ITerrainLabel label should not be modified until the draw action is complete, i.e., until the OnDrawingFinished event is sent.

 

JavaScript

 

DrawImageLabel (

       ImagePath,

       DrawingMode,

       GroupID,

       Left,

       Top)

 

C#

 

ITerrainLabel80 DrawImageLabel (

       String ImagePath,

       TerraExplorerX.DrawingMode = DrawingMode.DRAW_MODE_MAGNET,

       string GroupID = "",

       int Left = int.MaxValue,

       int Top = int.MaxValue)

 

C++

 

HRESULT DrawImageLabel (

       [in] BSTR ImagePath,

       [in] DrawingMode DrawingMode,

       [in] BSTR GroupID,

                [in] long Left,

       [in] long Top,

       [out, retval] ITerrainLabel80** pITerrainLabel80)

Parameters

ImagePath

Full path to a BMP, JPEG, GIF, PNG or ICO file to load as the image for the image label.

DrawingMode

An enum that determines an object's initial move mode, i.e., how it is moved in the 3D Window, and how the property sheet is displayed when the object is created. The DrawingMode enum is divided into two subgroups. This parameter can use a combination of values from the two subgroups, but no more than one value from each subgroup can be used.

Property Sheet Display Group – Use only one of the following values:

·          DRAW_MODE_SHOW_PROPERTY = 1
Open the property sheet including the top toolbar to edit the object.

·          DRAW_MODE_SHOW_PROPERTY_PANEL = 2
Open only the property sheet toolbar to edit the item.

Move Mode Group – Use only one of the following values:

·          DRAW_MODE_MAGNET = 4
Sets the edit mode to move the object based on where the mouse is pointing in the 3D Window. This makes it easier to move an object or node on a vertical plane or above a 3DML layer or other terrain object.

·          DRAW_MODE_XY = 8    
Set the edit mode to move the object in the XY plane.

GroupID

The ID of the group in which the label object should be created.

Left

The top left X position (in pixels) of the object's property sheet relative to the last position of the property sheet .

Top

The top left Y position (in pixels) of the object's property sheet relative to the last position of the property sheet.

Return Value

pITerrainLabel80

An ITerrainLabel representing the image label drawn. The return object can be used to set any of the properties of the drawn object.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.