PixelToWorld

Returns an IWorldPointInfo with information about a specified point on the window: its real world coordinates, and the ID and type of the object positioned at that point.

 

JavaScript

 

PixelToWorld(

       PixelX,

       PixelY,

       TypeFilterFlags)

 

C#

 

IWorldPointInfo80 PixelToWorld(

       int PixelX,

       int PixelY,

       WorldPointType TypeFilterFlags = WorldPointType.WPT_DEFAULT)

 

C++

 

HRESULT PixelToWorld(

       long PixelX,

       long PixelY,

       WorldPointType TypeFilterFlags,

       IWorldPointInfo80 ** pWorldPointInfo) 

 

Parameters

PixelX

The left-right coordinate in pixels of a specified point on the window.

PixelY

The top-bottom coordinate in pixels of a specified point on the window.

TypeFilterFlags

This parameter can be any combination of the values below. An object that is positioned at the specified point will be returned by IWorldPointInfo80.ObjectID only if its object type is one of the filter types passed. An object positioned at the specified point that is below the terrain or objects will be returned, as long as it is showing through the terrain or object based on its ShowThroughDistance.

·          WPT_TERRAIN                                  = 0

·          WPT_MODEL                                     = 1

·          WPT_LABEL                                        = 2

·          WPT_PRIMITIVE                               = 4

·          WPT_ANIM                                        = 8

·          WPT_BUILDING                                = 16

·          WPT_SKY                                             = 32

·          WPT_ACCURATE_CPT                    = 64

·          WPT_BBOX_CPT                              = 128

·          WPT_VIDEO                                       = 256

·          WPT_UNDERGROUND                   = 512

·          WPT_SCREEN_OVERLAY                = 1024

·          WPT_SCREEN_CONTROL              = 2048

·          WPT_SCREEN_COVERED              = 4096

·          WPT_3DML                                        = 8192

·          WPT_SURFACE                                 = 65536

·          WPT_DEFAULT                                  = -1

Return Value

pWorldPointInfo

An IWorldPointInfo80 representing information about the specified point, including its real world coordinates, and the ID and type of object positioned at the point. For an object type of WPT_SURFACE, null is returned for IWorldPointInfo80.ObjectID.

Exceptions

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