Share via


ICameraControl::get_FocalLengths method (vidcap.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The get_FocalLengths method returns the focal lengths of the camera lenses.

Syntax

HRESULT get_FocalLengths(
  [out] long *plOcularFocalLength,
  [out] long *plObjectiveFocalLengthMin,
  [out] long *plObjectiveFocalLengthMax
);

Parameters

[out] plOcularFocalLength

Receives the ocular focal length.

[out] plObjectiveFocalLengthMin

Receives the minimum objective focal length.

[out] plObjectiveFocalLengthMax

Receives the maximum objective focal length.

Return value

Returns an HRESULT value.

Remarks

In a two-lens camera, the objective lens is closer to the subject, and the ocular lens is closer to the camera. The ocular focal length is fixed. If the camera has an optical zoom, the objective focal length can vary within a fixed range. Magnification is calculated as the ratio of objective/ocular focal length. Because the magnification is expressed as a ratio, it has no units. Therefore, the units for the focal length are not defined by this interface.

If the camera supports optical zooming, the current zoom level is expressed as integer values between a range Zmin and Zmax. The objective focal length can then be calculated as follows:


Lcur = ( ( (Zcur - Zmin) * (Lmax - Lmin) ) / (Zmax - Zmin) ) + Lmin

where:

From
Lcur

, you can calculate the magnification.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2 [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header vidcap.h
Library Strmiids.lib

See also

Error and Success Codes

ICameraControl Interface