I have a customer who would like to disable autofocus programatically (ie--not permanently with the reg key below)
[HKEY_CURRENT_USER\Software\Symbol\pictures\camera\user] "CSPROPERTY_CAMERACONTROL_FOCUS" = dword:00000000 The reason for this is that autofocus takes somewhere between 1 andf 2 seconds and they want to disable it for all pictures taken at 4+ feet from the subject. In each work activity trhey need to taks about 10 pictures. Only 2 of the pictures require autofocus. Does anyone have a code sample using the Microsoft Direct Show API where they enable / disable autofocus without opening and closing the camera application??
Microsoft Direct Show--enable / disable autofocus |
1 Replies
Use IAMCameraControl and the Set method. There is a DS example in the WM 6.5.3 SDK. i.e. hRes = pCameraControl->Set( CameraControl_Flash, bFlag, CameraControl_Flags_Manual ); Set one of the following typedef enum tagCameraControlProperty { CameraControl_Pan = 0, CameraControl_Tilt = CameraControl_Pan + 1, CameraControl_Roll = CameraControl_Tilt + 1, CameraControl_Zoom = CameraControl_Roll + 1, CameraControl_Exposure = CameraControl_Zoom + 1, CameraControl_Iris = CameraControl_Exposure + 1, CameraControl_Focus = CameraControl_Iris + 1, CameraControl_Flash = CameraControl_Focus + 1 } CameraControlProperty; typedef enum tagCameraControlFlags { CameraControl_Flags_Auto = 0x1, CameraControl_Flags_Manual = 0x2 } CameraControlFlags; Note it may not be supported,you will need to test.