IDXSurfacePick Interface

The IDXSurfacePick interface enables picking, which is the process of identifying which of the transform inputs contributed to the output at a given point. The pick point often corresponds to the location where the user clicked the mouse on the output image and is handed by the container to the transform through this interface. This operation is also known as hit testing.

If multiple inputs contribute to the output at the specified point, the transform will choose only one of the inputs as the picked surface. The criteria for selecting a picked surface depend on the transform. This interface inherits from the IUnknown interface.

To use the IDXSurfacePick interface, call QueryInterface on the selected transform interface with IID_IDXSurfacePick as the interface ID.

CComPtr<IDXSurfacePick> cpPick;
m_cpDXTransform->QueryInterface(IID_IDXSurfacePick, (void **)&cpPick)))

You need to override the OnSurfacePick or OnGetSurfacePickOrder member functions of the CDXBaseNTo1 class to use picking.

For 3-D output a different picking technique is used. See the Author's Guide for more information.

IDXSurfacePick Method

PointPick Performs a surface pick at the specified output point.

IDXSurfacePick::PointPick

IDXSurfacePick Interface

Performs a surface pick at the specified output point.

Syntax

HRESULT PointPick(
    const DXVEC *pPoint,
    long *plInputSurfaceIndex,
    DXVEC *pInputPoint
);

Parameters

pPoint
[in] Pointer to a location on the output surface to use in the pick operation.
plInputSurfaceIndex
[out] Pointer to an indexed value of the input surface chosen by the surface pick.
pInputPoint
[out] Pointer to the location on the input surface that was selected by the surface pick. Because the transformed input might be inverted or rotated relative to its original orientation, pPoint and pInputPoint are not necessarily the same. The point returned is in the input surface's coordinate frame.

Return Value

Returns one of the following HRESULT values.
S_FALSENo surfaces were at the indicated pPoint.
S_OKOne of the input surfaces was chosen, so the returned information is valid.
DXT_S_HITOUTPUTThe output surface was hit at the indicated pPoint, but it was not one of the input surfaces. Procedural surfaces, which have no input surface, can only return this value and not a surface index.

Remarks

If an image transform has no inputs or cannot map the pick event back to one of the inputs, PointPick will return DXT_S_HITOUTPUT, if the pick point intersects the output surface. For example, this is the case for any procedural surface, such as the gradient surface.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.