Interface specification
Submitted by aristarco on Thu, 2006-07-20 19:09.
|
Public Member Functions |
| HRESULT | Battery ([out, retval] LONG *pVal) |
| | Gets battery status from the camera.
|
| HRESULT | Cancel ([in] BOOL newVal) |
| | Cancels any current sequence or download operation in progress.
|
| HRESULT | ConnectDual ([in] BSTR model,[in, defaultvalue("")] BSTR port,[in, defaultvalue("")] BSTR drive) |
| | Starts a session with the camera through a dual cable.
|
| HRESULT | ConnectSerial ([in] BSTR model,[in, defaultvalue("")] BSTR port) |
| | Starts a session with the camera through a Serial connection.
|
| HRESULT | ConnectUSB ([in] BSTR model,[in, defaultvalue("")] BSTR drive) |
| | Starts a session with the camera through a USB connection.
|
| HRESULT | Disconnect () |
| | Terminates a session with the camera.
|
| HRESULT | DownloadBasePath ([in] BSTR newVal) |
| | Configures the base path used in picture downloads from the camera.
|
| HRESULT | DownloadBasePath ([out, retval] BSTR *pVal) |
| | Gets the base path used in picture downloads from the camera.
|
| HRESULT | DownloadBehaviour ([in] BSTR newVal) |
| | Configures the behaviour used for picture downloads.
|
| HRESULT | DownloadBehaviour ([out, retval] BSTR *pVal) |
| | Gets current behaviour used for picture downloads.
|
| HRESULT | DownloadFilePattern ([in] BSTR newVal) |
| | Configures the pattern used for renaming the picture files when the picture downloading feature is used.
|
| HRESULT | DownloadFilePattern ([out, retval] BSTR *pVal) |
| | Gets the pattern used for file renaming in picture downloads from the camera.
|
| HRESULT | DownloadFolderPattern ([in] BSTR newVal) |
| | Configures the pattern used for subfolder creation when the picture downloading feature is used.
|
| HRESULT | DownloadFolderPattern ([out, retval] BSTR *pVal) |
| | Gets the pattern used for folder generation in picture downloads from the camera.
|
| HRESULT | EVCompensation ([in] DOUBLE newVal) |
| | Sets the exposure compensation value to the camera.
|
| HRESULT | EVCompensation ([out, retval] DOUBLE *pVal) |
| | Gets current exposure compensation value from the camera.
|
| HRESULT | Flash ([in] BSTR newVal) |
| | Sets the supplied flash mode to the camera.
|
| HRESULT | Flash ([out, retval] BSTR *pVal) |
| | Gets current flash mode from the camera.
|
| HRESULT | FocalLength ([in] DOUBLE newVal) |
| | Sets the focal length value to the camera.
|
| HRESULT | FocalLength ([out, retval] DOUBLE *pVal) |
| | Gets current focal length value from the camera.
|
| HRESULT | FocalLengthEquiv ([in] DOUBLE newVal) |
| | Sets a 35mm-equivalent focal length value to the camera.
|
| HRESULT | FocalLengthEquiv ([out, retval] DOUBLE *pVal) |
| | Gets current 35mm-equivalent focal length value from the camera.
|
| HRESULT | FocalLengthMax ([out, retval] DOUBLE *pVal) |
| | Gets maximum possible focal length value supported by the camera.
|
| HRESULT | FocalLengthMaxEquiv ([out, retval] DOUBLE *pVal) |
| | Gets maximum possible focal length value (35mm-equivalent) supported by the camera.
|
| HRESULT | FocalLengthMin ([out, retval] DOUBLE *pVal) |
| | Gets minimum possible focal length value supported by the camera.
|
| HRESULT | FocalLengthMinEquiv ([out, retval] DOUBLE *pVal) |
| | Gets minimum possible focal length value (35mm-equivalent) supported by the camera.
|
| HRESULT | Focus ([in] BSTR newVal) |
| | Sets the supplied focus mode to the camera.
|
| HRESULT | Focus ([out, retval] BSTR *pVal) |
| | Gets current focus mode from the camera.
|
| HRESULT | FreeMemory ([out, retval] LONG *pVal) |
| | Gets the free space available on the memory card.
|
| HRESULT | IsLCDOn ([out, retval] BOOL *pVal) |
| | Returns camera LCD status.
|
| HRESULT | Log ([in] BSTR msg) |
| | Writes a user-supplied message to the log file.
|
| HRESULT | Message ([out, retval] BSTR *pVal) |
| | Gets the last status message generated by kcamserver.
|
| HRESULT | Metering ([in] BSTR newVal) |
| | Sets the supplied metering mode to the camera.
|
| HRESULT | Metering ([out, retval] BSTR *pVal) |
| | Gets current metering mode from the camera.
|
| HRESULT | NextValidResolution ([out, retval] BSTR *pVal) |
| | Retrieves the supported resolution values of the camera.
|
| HRESULT | Progress ([out, retval] LONG *pVal) |
| | Gets the progress percentage value of the current shoot or download operation.
|
| HRESULT | Remaining ([out, retval] LONG *pVal) |
| | Gets the number of remaining pictures.
|
| HRESULT | Resolution ([in] BSTR newVal) |
| | Sets the supplied resolution/quality value to the camera.
|
| HRESULT | Resolution ([out, retval] BSTR *pVal) |
| | Gets current resolution/quality value from the camera.
|
| HRESULT | SerialNo ([out, retval] BSTR *pVal) |
| | Gets serial number of the camera.
|
| HRESULT | Shoot () |
| | Takes a single shot.
|
| HRESULT | ShootBulb ([in] DOUBLE speed) |
| | Takes a single bulb shot (requires a serial connection).
|
| HRESULT | ShootBulbSequence ([in] DOUBLE speed,[in] LONG repeat,[in] DOUBLE interval,[in, defaultvalue(0.0)] DOUBLE initial) |
| | Takes a sequence of bulb shots (requires a serial connection).
|
| HRESULT | ShootSequence ([in] LONG repeat,[in] DOUBLE interval,[in, defaultvalue(0.0)] DOUBLE initial) |
| | Takes a sequence of shots.
|
| HRESULT | SleepUntil (BSTR time) |
| | Stops the execution until the specified time is reached.
|
| HRESULT | State ([out, retval] LONG *pVal) |
| | Gets the internal state of kcamserver.
|
| HRESULT | SwitchToSerial () |
| | Switches the dual cable from USB to Serial mode.
|
| HRESULT | SwitchToUSB () |
| | Switches the dual cable from Serial to USB mode.
|
| HRESULT | TurnLCDOff () |
| | Turns off the camera LCD.
|
| HRESULT | TurnLCDOn () |
| | Turns on the camera LCD.
|
| HRESULT | UnplugUSB () |
| | Invokes the USB unplug/eject mechanism so the camera can be safely unpluged from the computer (Win2K/XP only).
|
| HRESULT | WhiteBalance ([in] BSTR newVal) |
| | Sets the supplied white balance mode to the camera.
|
| HRESULT | WhiteBalance ([out, retval] BSTR *pVal) |
| | Gets current white balance mode from the camera.
|
| HRESULT | ZoomTeleStart () |
| | Emulates T (tele zoom) button depression.
|
| HRESULT | ZoomTeleStop () |
| | Emulates T (tele zoom) button release.
|
| HRESULT | ZoomWideStart () |
| | Emulates W (wide zoom) button depression.
|
| HRESULT | ZoomWideStop () |
| | Emulates W (wide zoom) button release.
|
Detailed Description
This interface is implemented by the class Camera. Some examples are included using Visual Basic Script.
To instantiate the class you can use the following code. Keep in mind that kcamserver.dll must be accessible by the script (with extension .vbs) Dim cam
Set cam = CreateObject("kcamserver.Camera")
...
... (do something with cam)
...
Set cam = Nothing
Member Function Documentation
| HRESULT ICamera::Battery |
( |
[out, retval] LONG * |
pVal |
) |
|
|
|
|
Gets battery status from the camera.
...
MsgBox("Battery at " & cam.Battery & "%")
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Current battery status. Value 0 means that an external supply is powering the camera. |
- Remarks:
- Access to this property involves communication with the camera.
Don't expect precise values here.
|
| HRESULT ICamera::Cancel |
( |
[in] BOOL |
newVal |
) |
|
|
|
|
Cancels any current sequence or download operation in progress.
Included for graphical user interfaces based on kcamserver.
- Precondition:
- Camera should be in a "BusyCancellable" state (sequence or download operation).
- Parameters:
-
| [in] | pVal | Set to True in order to cancel the operation. |
- Remarks:
- kcamserver will try to cancel "cleanly", this may take some time.
|
| HRESULT ICamera::ConnectDual |
( |
[in] BSTR |
model, |
|
|
[in, defaultvalue("")] BSTR |
port, |
|
|
[in, defaultvalue("")] BSTR |
drive |
|
) |
|
|
|
|
Starts a session with the camera through a dual cable.
The session starts in USB mode.
...
cam.ConnectDual "Coolpix 995", "COM1", "G:"
...
- Precondition:
- Camera should be plugged using a dual cable (and should be in the "Disconnected" state).
- Parameters:
-
| [in] | model | Name of the camera model. Valid names are:
- "Coolpix 885"
- "Coolpix 995"
- "Coolpix 2500"
- "Coolpix 3500"
- "Coolpix 4300"
- "Coolpix 4500"
- "Coolpix 5000"
- "Coolpix 5400"
- "Coolpix 5600"
- "Coolpix 5700"
- "Coolpix 7600"
- "Coolpix 8400"
- "Coolpix 8700"
- "Coolpix 8800"
|
| [in] | port | (Optional) You can specify the serial port device, e.g. "COM1". If not specified, kcamserver will search for a compatible device. |
| [in] | drive | (Optional) On Windows2K/XP, you can specify the drive letter, e.g. "G:". If not specified, kcamserver will search for a compatible device. On Windows 98, this parameter is ignored. |
- Remarks:
- Invocation of this method involves communication with the camera. It takes several seconds to establish the connection.
- See also:
- SwitchToSerial, SwitchToUSB to switch between the modes available on dual connections.
http://aristarco.cjb.net for more information on dual cabless supported by kcamserver.
ConnectUSB, ConnectSerial
|
| HRESULT ICamera::ConnectSerial |
( |
[in] BSTR |
model, |
|
|
[in, defaultvalue("")] BSTR |
port |
|
) |
|
|
|
|
Starts a session with the camera through a Serial connection.
...
cam.ConnectSerial "Coolpix 995", "COM1"
...
- Precondition:
- Camera should be plugged using a serial cable (and should be in the "Disconnected" state).
- Parameters:
-
| [in] | model | Name of the camera model. Valid names are:
- "Coolpix 885"
- "Coolpix 995"
- "Coolpix 2500"
- "Coolpix 3500"
- "Coolpix 4300"
- "Coolpix 4500"
- "Coolpix 5000"
- "Coolpix 5400"
- "Coolpix 5600"
- "Coolpix 5700"
- "Coolpix 7600"
- "Coolpix 8400"
- "Coolpix 8700"
- "Coolpix 8800"
|
| [in] | port | (Optional) You can specify the serial port device, e.g. "COM1". If not specified, kcamserver will search for a compatible device. |
- Remarks:
- Invocation of this method involves communication with the camera. It takes several seconds to establish the connection.
- See also:
- ConnectUSB, ConnectDual
|
| HRESULT ICamera::ConnectUSB |
( |
[in] BSTR |
model, |
|
|
[in, defaultvalue("")] BSTR |
drive |
|
) |
|
|
|
|
Starts a session with the camera through a USB connection.
...
cam.ConnectUSB "Coolpix 995", "G:"
...
- Precondition:
- Camera should be plugged using a USB cable (and should be in the "Disconnected" state).
- Parameters:
-
| [in] | model | Name of the camera model. Valid names are:
- "Coolpix 885"
- "Coolpix 995"
- "Coolpix 2500"
- "Coolpix 3500"
- "Coolpix 4300"
- "Coolpix 4500"
- "Coolpix 5000"
- "Coolpix 5400"
- "Coolpix 5600"
- "Coolpix 5700"
- "Coolpix 7600"
- "Coolpix 8400"
- "Coolpix 8700"
- "Coolpix 8800"
|
| [in] | drive | (Optional) On Windows2K/XP, you can specify the drive letter, e.g. "G:". If not specified, kcamserver will search for a compatible device. On Windows 98, this parameter is ignored. |
- Remarks:
- Invocation of this method involves communication with the camera. It takes several seconds to establish the connection.
- See also:
- ConnectSerial, ConnectDual
|
| HRESULT ICamera::Disconnect |
( |
|
) |
|
|
|
|
Terminates a session with the camera.
Should be invoked always before the program ends.
...
cam.ConnectUSB "Coolpix 995"
...
cam.Disconnect
...
- Precondition:
- Camera must be in "Ready" state (connected and not busy).
- Remarks:
- Invocation of this method involves communication with the camera. It may take a few seconds to perform this action.
- See also:
- ConnectUSB, ConnectSerial, ConnectDual, UnplugUSB
|
| HRESULT ICamera::DownloadBasePath |
( |
[in] BSTR |
newVal |
) |
|
|
|
|
Configures the base path used in picture downloads from the camera.
This property is used in conjunction with DownloadFolderPattern(BSTR) to generate the full path for the picture downloads.
By default, the base path points to My Documents folder.
...
cam.DownloadBasePath = "d:\kcam images"
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Base path for downloads. |
- See also:
- DownloadFolderPattern(BSTR) and DownloadFilePattern(BSTR) for more information on picture downloads.
|
| HRESULT ICamera::DownloadBasePath |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets the base path used in picture downloads from the camera.
...
MsgBox("The base path for downloads is " & cam.DownloadBasePath)
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Base path for downloads. |
- Remarks:
- This value is retrieved from internal variables. It does not involve any communication with the camera.
- See also:
- DownloadBaseFolder(BSTR) for more information.
|
| HRESULT ICamera::DownloadBehaviour |
( |
[in] BSTR |
newVal |
) |
|
|
|
|
Configures the behaviour used for picture downloads.
...
cam.DownloadBehaviour = "After each shot"
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Download behaviour in string format. Supported values are:
- "Off": pictures will not be downloaded. This is the default value.
- "After each shot": pictures are downloaded as they are taken. Since pictures are actually moved (erased) from the camera memory card, sequences may involve any number of pictures. Keep in mind that this behaviour will require larger intervals between pictures.
- "After last shot": pictures are downloaded at the end of each sequence. Intervals may be shorter that using "after each shot" behaviour, but the maximum number of pictures in a sequence is limited by the size of the memory card.
|
- Remarks:
- This value is retrieved from internal variables. It does not involve any communication with the camera.
|
| HRESULT ICamera::DownloadBehaviour |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets current behaviour used for picture downloads.
...
MsgBox("Current download behaviour is: " & cam.DownloadBehaviour)
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Current download behaviour in string format, i.e. "After each shot". |
- Remarks:
- This value is retrieved from internal variables. It does not involve any communication with the camera.
- See also:
- DownloadBehaviour(BSTR) for more information.
|
| HRESULT ICamera::DownloadFilePattern |
( |
[in] BSTR |
newVal |
) |
|
|
|
|
Configures the pattern used for renaming the picture files when the picture downloading feature is used.
This property is used to specify a rule for picture file renaming. Under the path given by the base path and folder pattern, krinnicam downloads the pictures and renames them following this pattern. The pattern is specified using a very simple notation, where the specifiers "%d", "%t" and "%s" have special meaning:
- %d is substituted with the picture date;
- %t is substituted with the picture time;
- %s is substituted with a sequential number, which is incremented on each picture download.
By default, the file pattern is "KCAM%s", so pictures will be renamed to (original file extension is preserved) "KCAM0001", "KCAM0002", "KCAM0003", etc.
In the following example, the files will be named with the date and time: "2006-05-18_21-58-12", "2006-05-18_22-08-12", etc. so we get our pictures organized cronologically.
...
cam.DownloadFilePattern = "%d_%t"
...
- Precondition:
- None
- Parameters:
-
- See also:
- DownloadBasePath(BSTR) and DownloadFolderPattern(BSTR) for more information on picture downloads.
|
| HRESULT ICamera::DownloadFilePattern |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets the pattern used for file renaming in picture downloads from the camera.
...
MsgBox("The file naming pattern used for downloads is " & cam.DownloadFilePattern)
...
- Precondition:
- None
- Parameters:
-
- Remarks:
- This value is retrieved from internal variables. It does not involve any communication with the camera.
- See also:
- DownloadFilePattern(BSTR) for more information.
|
| HRESULT ICamera::DownloadFolderPattern |
( |
[in] BSTR |
newVal |
) |
|
|
|
|
Configures the pattern used for subfolder creation when the picture downloading feature is used.
This property is used in conjunction with DownloadBasePath(BSTR) to generate the full path for the picture downloads. Under the base path, krinnicam creates subfolders following this pattern to store pictures. The pattern is specified using a very simple notation, where the specifiers "%d", "%t" and "%s" have special meaning:
- %d is substituted with the picture date;
- %t is substituted with the picture time (maybe not very useful in the case of folders);
- %s is substituted with a sequential number, which is incremented on each call to a "ShootXXX" method.
By default, the folder pattern is empty (""), so subfolders are not generated (i.e., pictures are moved directly to the base path folder)
In the following example, the folders will be named "kcam_2006-05-18", "kcam_2006-05-19", etc. so we get our pictures organized by date.
...
cam.DownloadFolderPattern = "kcam_%d"
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Folder pattern. |
- See also:
- DownloadBasePath(BSTR) and DownloadFilePattern(BSTR) for more information on picture downloads.
|
| HRESULT ICamera::DownloadFolderPattern |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets the pattern used for folder generation in picture downloads from the camera.
...
MsgBox("The folder pattern used for downloads is " & cam.DownloadFolderPattern)
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Folder pattern. |
- Remarks:
- This value is retrieved from internal variables. It does not involve any communication with the camera.
- See also:
- DownloadFolderPattern(BSTR) for more information.
|
| HRESULT ICamera::EVCompensation |
( |
[in] DOUBLE |
newVal |
) |
|
|
|
|
Sets the exposure compensation value to the camera.
...
cam.EVCompensation = -0.3
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | newVal | Exposure compensation value. The supported values are: -2.0, -1.7, -1.3, -1.0, -0.7, -0.3, 0, +0.3, +0.7, +1.0, +1.3, +1.7, +2.0. Any other values are "rounded" to the nearest of those listed. |
- Remarks:
- Access to this property involves communication with the camera.
|
| HRESULT ICamera::EVCompensation |
( |
[out, retval] DOUBLE * |
pVal |
) |
|
|
|
|
Gets current exposure compensation value from the camera.
...
MsgBox("The current exposure compensation value is " & cam.EVCompensation)
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Current exposure compensation value, i.e. -0.3. |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- EVCompensation(DOUBLE) for a description of the supported exposure compensation values.
|
| HRESULT ICamera::Flash |
( |
[in] BSTR |
newVal |
) |
|
|
|
|
Sets the supplied flash mode to the camera.
...
cam.Flash = "Incandescent"
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | newVal | Flash mode in string format. Possible values are:
- "Auto"
- "Force"
- "Off"
- "Red Eye"
- "Slow Sync"
|
- Remarks:
- Access to this property involves communication with the camera.
|
| HRESULT ICamera::Flash |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets current flash mode from the camera.
...
MsgBox("The current flash mode is " & cam.Flash)
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Current flash mode in string format, i.e. "Incandescent". |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- Flash(BSTR) for a description of the supported flash modes.
|
| HRESULT ICamera::FocalLength |
( |
[in] DOUBLE |
newVal |
) |
|
|
|
|
Sets the focal length value to the camera.
...
cam.FocalLength = 8.2
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | newVal | Focal length value in milimeters. This value should be within the range printed on the camera lens. If a smaller or bigger value is written to this property, it will be automatically clipped. |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- FocalLengthMin(DOUBLE *) to get the minimum possible focal length value for the camera.
FocalLengthMax(DOUBLE *) to get the maximum possible focal length value for the camera.
FocalLengthEquiv(DOUBLE) if you prefer to use 35mm-equivalent focal length values.
|
| HRESULT ICamera::FocalLength |
( |
[out, retval] DOUBLE * |
pVal |
) |
|
|
|
|
Gets current focal length value from the camera.
...
MsgBox("The current focal length is " & cam.FocalLength & " mm")
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Current focal length value (in milimeters), i.e. 8.2. This value is in the focal range printed on the camera lens. |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- FocalLengthMin(DOUBLE *) to get the minimum possible focal length value for the camera.
FocalLengthMax(DOUBLE *) to get the maximum possible focal length value for the camera.
FocalLengthEquiv(DOUBLE *) if you prefer to use 35mm-equivalent focal length values.
|
| HRESULT ICamera::FocalLengthEquiv |
( |
[in] DOUBLE |
newVal |
) |
|
|
|
|
Sets a 35mm-equivalent focal length value to the camera.
...
cam.FocalLengthEquiv = 38.0
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | newVal | 35mm-equivalent focal length value. This value should be within the range supported by the camera. If a smaller or bigger value is written to this property, it will be automatically clipped. |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- FocalLengthMinEquiv(DOUBLE *) to get the minimum possible 35mm-equivalent focal length value for the camera.
FocalLengthMaxEquiv(DOUBLE *) to get the maximum possible 35mm-equivalent focal length value for the camera.
FocalLength(DOUBLE) if you prefer to use true focal length values.
|
| HRESULT ICamera::FocalLengthEquiv |
( |
[out, retval] DOUBLE * |
pVal |
) |
|
|
|
|
Gets current 35mm-equivalent focal length value from the camera.
...
MsgBox("The current focal length is " & cam.FocalLengthEquiv & " mm (35mm-equivalent)")
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Current focal length value (35mm-equivalent), i.e. 38.0. This value is the result of a conversion made using real focal length values, and it is based on vendor specifications. |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- FocalLengthMinEquiv(DOUBLE *) to get the minimum possible 35mm-equivalent focal length value for the camera.
FocalLengthMaxEquiv(DOUBLE *) to get the maximum possible 35mm-equivalent focal length value for the camera.
FocalLength(DOUBLE *) if you prefer to use true focal length values.
|
| HRESULT ICamera::FocalLengthMax |
( |
[out, retval] DOUBLE * |
pVal |
) |
|
|
|
|
Gets maximum possible focal length value supported by the camera.
...
MsgBox("The maximum focal length value supported by this camera is " & cam.FocalLengthMax & " mm")
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Maximum focal length value (in milimeters). This value should match the one printed on the camera lens. |
- Remarks:
- This value is retrieved from an internal database containing vendor specifications. It does not involve any communication with the camera.
- See also:
- FocalLength(DOUBLE *) to get the current focal length value for the camera.
FocalLengthMinEquiv(DOUBLE *) if you prefer to use 35mm-equivalent focal length values.
|
| HRESULT ICamera::FocalLengthMaxEquiv |
( |
[out, retval] DOUBLE * |
pVal |
) |
|
|
|
|
Gets maximum possible focal length value (35mm-equivalent) supported by the camera.
...
MsgBox("The maximum focal length value supported by this camera is " & cam.FocalLengthMaxEquiv & " mm (35mm-equivalent)")
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Maximum focal length value (35mm-equivalent). |
- Remarks:
- This value is retrieved from an internal database containing vendor specifications. It does not involve any communication with the camera.
- See also:
- FocalLengthEquiv(DOUBLE *) to get the current focal length value (35mm-equivalent) for the camera.
FocalLengthMin(DOUBLE *) if you prefer to use true focal length values.
|
| HRESULT ICamera::FocalLengthMin |
( |
[out, retval] DOUBLE * |
pVal |
) |
|
|
|
|
Gets minimum possible focal length value supported by the camera.
...
MsgBox("The minimum focal length value supported by this camera is " & cam.FocalLengthMin & " mm")
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Minimum focal length value (in milimeters). This value should match the one printed on the camera lens. |
- Remarks:
- This value is retrieved from an internal database containing vendor specifications. It does not involve any communication with the camera.
- See also:
- FocalLength(DOUBLE *) to get the current focal length value for the camera.
FocalLengthMinEquiv(DOUBLE *) if you prefer to use 35mm-equivalent focal length values.
|
| HRESULT ICamera::FocalLengthMinEquiv |
( |
[out, retval] DOUBLE * |
pVal |
) |
|
|
|
|
Gets minimum possible focal length value (35mm-equivalent) supported by the camera.
...
MsgBox("The minimum focal length value supported by this camera is " & cam.FocalLengthMinEquiv & " mm (35mm-equivalent)")
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Minimum focal length value (35mm-equivalent). |
- Remarks:
- This value is retrieved from an internal database containing vendor specifications. It does not involve any communication with the camera.
- See also:
- FocalLengthEquiv(DOUBLE *) to get the current focal length value (35mm-equivalent) for the camera.
FocalLengthMin(DOUBLE *) if you prefer to use true focal length values.
|
| HRESULT ICamera::Focus |
( |
[in] BSTR |
newVal |
) |
|
|
|
|
Sets the supplied focus mode to the camera.
...
cam.Focus = "Macro"
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | newVal | Focus mode in string format. Possible values are:
|
- Remarks:
- Access to this property involves communication with the camera.
|
| HRESULT ICamera::Focus |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets current focus mode from the camera.
...
MsgBox("The current focus mode is " & cam.Focus)
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Current focus mode in string format, i.e. "Macro". |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- Focus(BSTR) for a description of the supported focus modes.
|
| HRESULT ICamera::FreeMemory |
( |
[out, retval] LONG * |
pVal |
) |
|
|
|
|
Gets the free space available on the memory card.
...
MsgBox("Free space on memory card: " & cam.FreeMemory & " bytes")
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Free space, in bytes. |
- Remarks:
- Access to this property involves communication with the camera.
|
| HRESULT ICamera::IsLCDOn |
( |
[out, retval] BOOL * |
pVal |
) |
|
|
|
|
Returns camera LCD status.
...
MsgBox("LCD is " & IIf(cam.IsLCDOn, "on", "off"))
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | True if LCD is off. |
- Remarks:
- Access to this property does not involve communication with the camera.
- See also:
- TurnLCDOn, TurnLCDOff to change LCD status.
- Since:
- version 2.02
|
| HRESULT ICamera::Log |
( |
[in] BSTR |
msg |
) |
|
|
|
|
Writes a user-supplied message to the log file.
This example: ...
cam.Log "My message"
...
writes the following line in the log file: hh:mm:ss.sss User message: My message
. - Precondition:
- None
- Parameters:
-
- Remarks:
- Invocation of this method does not involve communication with the camera.
|
| HRESULT ICamera::Message |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets the last status message generated by kcamserver.
Included for graphical user interfaces based on kcamserver.
- Precondition:
- None
- Parameters:
-
- Remarks:
- This value is retrieved from internal variables. It does not involve any communication with the camera.
|
| HRESULT ICamera::Metering |
( |
[in] BSTR |
newVal |
) |
|
|
|
|
Sets the supplied metering mode to the camera.
...
cam.Metering = "Incandescent"
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | newVal | Metering mode in string format. Possible values are:
- "Center Weighted"
- "Spot"
- "Matrix"
|
- Remarks:
- Access to this property involves communication with the camera.
|
| HRESULT ICamera::Metering |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets current metering mode from the camera.
...
MsgBox("The current metering mode is " & cam.Metering)
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Current metering mode in string format, i.e. "Incandescent". |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- Metering(BSTR) for a description of the supported metering modes.
|
| HRESULT ICamera::NextValidResolution |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Retrieves the supported resolution values of the camera.
The following example writes the supported resolution values of a Coolpix 4500 in the log file. Note that it will work even if the camera is not actually connected to the computer (here, ConnectUSB may fail but execution will continue anyway).
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Valid resolution mode. You can get all the possible values accesing repeatedly to this property, see the example. |
- Remarks:
- This value is retrieved from an internal database containing vendor specifications. It does not involve any communication with the camera.
|
| HRESULT ICamera::Progress |
( |
[out, retval] LONG * |
pVal |
) |
|
|
|
|
Gets the progress percentage value of the current shoot or download operation.
Included for graphical user interfaces based on kcamserver.
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Progress value (0..100). |
- Remarks:
- This value is retrieved from internal variables. It does not involve any communication with the camera.
|
| HRESULT ICamera::Remaining |
( |
[out, retval] LONG * |
pVal |
) |
|
|
|
|
Gets the number of remaining pictures.
Returned value is based on free space on memory card and average picture size, as reported by the camera.
...
MsgBox(cam.Remaining & " pictures remaining")
...
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Number of remaining pictures. |
- Remarks:
- Access to this property involves communication with the camera if it is in Ready state.
If the camera is busy, the last known value is returned.
|
| HRESULT ICamera::Resolution |
( |
[in] BSTR |
newVal |
) |
|
|
|
|
Sets the supplied resolution/quality value to the camera.
...
cam.Resolution = "640x480 Normal"
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | newVal | Resolution/quality in string format, i.e. "640x480 Normal". |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- NextValidResolution(BSTR *) to learn how to get the supported resolution/quality values in a specific model.
|
| HRESULT ICamera::Resolution |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets current resolution/quality value from the camera.
...
MsgBox("The current resolution is " & cam.Resolution)
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Current resolution/quality in string format, i.e. "640x480 Normal". |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- NextValidResolution(BSTR *) to learn how to get the supported resolution/quality values in a specific model.
|
| HRESULT ICamera::SerialNo |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets serial number of the camera.
...
MsgBox("Serial number: " & cam.SerialNo)
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Serial number. |
- Remarks:
- Access to this property involves communication with the camera.
|
| HRESULT ICamera::Shoot |
( |
|
) |
|
|
|
|
Takes a single shot.
If downloads are enabled, it also moves the picture to the computer.
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Remarks:
- Invocation of this method involves communication with the camera. It may take a few seconds to perform this action.
- See also:
- ShootSequence, ShootBulb, ShootBulbSequence
|
| HRESULT ICamera::ShootBulb |
( |
[in] DOUBLE |
speed |
) |
|
|
|
|
Takes a single bulb shot (requires a serial connection).
If downloads are enabled, it also moves the picture to the computer.
In order to take bulb shots, the camera should be manually set to Bulb mode; in this case, the shutter speed is under kcamserver control, see parameter shutter below. Otherwise, the shutter speed set on the camera will be used instead of the supplied shutter speed (which will be ignored).
...
cam.ShootBulb 2.0
...
- Precondition:
- Camera in Serial mode.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | speed | Shutter speed in seconds. Lowest possible value is about 0.03 seconds (1/30s). Highest possible value despends on your model. |
- Remarks:
- This action may take from seconds to hours or even days, depending on the parameters given.
Invocation of this method involves communication with the camera.
This method uses the MC-EU1 emulation mode of the camera, that requires to turn on the LCD in order to take shots. If you want to keep the LCD off during the exposure, you can use the camera MONITOR button before this method is invoked (first call TurnLCDOn, then use the MONITOR button on camera to manually turn if off, then call TurnLCDOff)
- See also:
- Shoot, ShootSequence, ShootBulbSequence
|
| HRESULT ICamera::ShootBulbSequence |
( |
[in] DOUBLE |
speed, |
|
|
[in] LONG |
repeat, |
|
|
[in] DOUBLE |
interval, |
|
|
[in, defaultvalue(0.0)] DOUBLE |
initial |
|
) |
|
|
|
|
Takes a sequence of bulb shots (requires a serial connection).
If downloads are enabled, it also moves the pictures to the computer.
In order to take bulb shots, the camera should be manually set to Bulb mode; in this case, the shutter speed is under kcamserver control, see parameter speed below. Otherwise, the shutter speed set on the camera will be used instead of the supplied shutter speed (which will be ignored).
In the following example, the sequence is started 15 seconds after the function is invoked, the interval between consecutive exposures is 45 seconds, and a number of 10 pictures will be taken. The shutter speed will be 2 seconds (if the camera has been manually set to Bulb mode). It is good idea, if you need accurate timings, to include a initial value for the sequence commands, to allow for LCD startup time, focusing, etc. ...
cam.ShootBulbSequence 2.0, 10, 45.0, 15.0
...
- Precondition:
- Camera in Serial mode.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | speed | Shutter speed in seconds. Lowest possible value is about 0.03 seconds (1/30s). Highest possible value despends on your model. |
| [in] | repeat | Number of pictures to take. |
| [in] | interval | Time elapsed between consecutive exposures (measured from exposure start to exposure start), in seconds. |
| [in] | initial | (Optional) Time elapsed since this method is invoked to the first exposure, in seconds. By default, it is 0 (which means "as soon as you can", see below). |
- Remarks:
- Shooting will take place even If interval or initial values are too short for the camera to respond on time. In this case, the pictures will be taken as soon as the camera can do the job.
This action may take from seconds to hours or even days, depending on the parameters given.
On big intervals, kcamserver will periodically communicate with the camera to keep it awake.
Invocation of this method involves communication with the camera.
This method uses the MC-EU1 emulation mode of the camera, that requires to turn on the LCD in order to take shots. If you want to keep the LCD off during exposures, you can use the camera MONITOR button after the first shot is taken (or before this method is invoked, but in this case you will have to follow this procedure: first call TurnLCDOn, then use the MONITOR button on camera to manually turn if off, then call TurnLCDOff)
- See also:
- Shoot, ShootSequence, ShootBulb, Cancel
|
| HRESULT ICamera::ShootSequence |
( |
[in] LONG |
repeat, |
|
|
[in] DOUBLE |
interval, |
|
|
[in, defaultvalue(0.0)] DOUBLE |
initial |
|
) |
|
|
|
|
Takes a sequence of shots.
If downloads are enabled, it also moves the pictures to the computer.
In the following example, the sequence is started 15 seconds after the function is invoked, the interval between consecutive exposures is 45 seconds, and a number of 10 pictures will be taken. ...
cam.ShootSequence 10, 45.0, 15.0
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | repeat | Number of pictures to take. |
| [in] | interval | Time elapsed between consecutive exposures (measured from exposure start to exposure start), in seconds. |
| [in] | initial | (Optional) Time elapsed since this method is invoked to the first exposure, in seconds. By default, it is 0 (which means "as soon as you can", see below). |
- Remarks:
- Shooting will take place even If interval or initial values are too short for the camera to respond on time. In this case, the pictures will be taken as soon as the camera can do the job.
On big intervals, kcamserver will periodically communicate with the camera to keep it awake.
Invocation of this method involves communication with the camera. This action may take from seconds to hours or even days, depending on the parameters given.
- See also:
- Shoot, ShootBulb, ShootBulbSequence, Cancel
|
| HRESULT ICamera::SleepUntil |
( |
BSTR |
time |
) |
|
|
|
|
Stops the execution until the specified time is reached.
This method helps to synchronize your scripts with the local time. Included for scripts based on kcamserver.
Say now it is 13:45:22. In the following example, ShootBulbSequence will be invoked when the time matches "*:29:30", what will take place at 14:29:30. 30 seconds after (at 14:30:00), the first shot of the sequence is taken. Since the interval is 3600 seconds, every next shot will be taken at each hour: 15:30:00, 16:30:00, etc., until a number of 24 pictures has been taken (therefore, covering a whole day). It is good idea, if you need accurate timings, to include a initial value for the sequence commands, to allow for LCD startup time, focusing, etc. ...
cam.SleepUntil "*:29:30"
cam.ShootBulbSequence 1.0, 24, 3600.0, 30.0
...
- Precondition:
- None.
- Parameters:
-
| [in] | time | Time specifier in "hh:mm:ss" format. You can use the wildcard '*' instead of hh, mm, or ss, with the meaning "any". |
- Remarks:
- Invocation of this method involves communication with the camera. It may take from seconds to hours to perform this action.
|
| HRESULT ICamera::State |
( |
[out, retval] LONG * |
pVal |
) |
|
|
|
|
Gets the internal state of kcamserver.
Included for graphical user interfaces based on kcamserver.
- Precondition:
- None
- Parameters:
-
| [out] | pVal | Current internal status. Possible values are:
- (-1): Unknown
- 0: Disconnected
- 1: Connecting
- 2: Ready
- 3: Busy
- 4: BusyCancellable
- 5: Cancelling
- 6: Disconnecting
- 7: Unplugging
|
- Remarks:
- This value is retrieved from internal variables. It does not involve any communication with the camera.
|
| HRESULT ICamera::SwitchToSerial |
( |
|
) |
|
|
|
|
Switches the dual cable from USB to Serial mode.
...
cam.SwitchToSerial
...
- Precondition:
- Camera connected by dual cable, in USB mode and "Ready" state.
- Remarks:
- Invocation of this method involves communication with the camera. It may take several seconds to perform this action.
|
| HRESULT ICamera::SwitchToUSB |
( |
|
) |
|
|
|
|
Switches the dual cable from Serial to USB mode.
- Precondition:
- Camera connected by dual cable, in Serial mode and "Ready" state.
- Remarks:
- Invocation of this method involves communication with the camera. It may take several seconds to perform this action.
|
| HRESULT ICamera::TurnLCDOff |
( |
|
) |
|
|
|
|
Turns off the camera LCD.
If the connection with the camera is serial, this method exits from the MC-EU1 emulation mode, returning to the standard mode (this disables camera buttons).
- Precondition:
- Camera should be connected and in "Ready" state, with the LCD on.
- Remarks:
- Invocation of this method involves communication with the camera. It takes several seconds to perform this action.
- See also:
- TurnLCDOn
|
| HRESULT ICamera::TurnLCDOn |
( |
|
) |
|
|
|
|
Turns on the camera LCD.
If the connection with the camera is serial, this method enables the MC-EU1 emulation mode. Under this mode, the camera buttons are responsive, so you can use them to change settings. MC-EU1 mode is unavailable under a USB connection, so this method just turns on the LCD, camera buttons are still disabled.
- Precondition:
- Camera should be connected and in "Ready" state, with the LCD off.
- Remarks:
- Invocation of this method involves communication with the camera. It takes several seconds to perform this action.
- See also:
- TurnLCDOff
|
| HRESULT ICamera::UnplugUSB |
( |
|
) |
|
|
|
|
Invokes the USB unplug/eject mechanism so the camera can be safely unpluged from the computer (Win2K/XP only).
UnplugUSB will disconnect first if the camera is in the "Ready" state (so it is not needed to call Disconnect).
...
cam.ConnectUSB "Coolpix 995"
...
cam.Disconnect ' not needed
cam.UnplugUSB
...
- Precondition:
- unplug.dll must be available.
- Windows 2000/XP only; on Windows 98 this method is ignored.
- Camera must be in USB mode, in the "Ready" or "Disconnected" state.
- Remarks:
- Invocation of this method involves communication with the camera. It may take a few seconds to perform this action.
- See also:
- ConnectUSB, Disconnect
|
| HRESULT ICamera::WhiteBalance |
( |
[in] BSTR |
newVal |
) |
|
|
|
|
Sets the supplied white balance mode to the camera.
...
cam.WhiteBalance = "Incandescent"
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [in] | newVal | White balance mode in string format. Possible values are:
- "Auto"
- "Sunny"
- "Fluorescent"
- "Incandescent"
- "Speedlight"
- "Preset"
- "Cloudy"
|
- Remarks:
- Access to this property involves communication with the camera.
|
| HRESULT ICamera::WhiteBalance |
( |
[out, retval] BSTR * |
pVal |
) |
|
|
|
|
Gets current white balance mode from the camera.
...
MsgBox("The current white balance mode is " & cam.WhiteBalance)
...
- Precondition:
- Camera in USB mode OR Serial mode with LCD turned off.
- Camera object must be in "Ready" state (connected and not busy).
- Parameters:
-
| [out] | pVal | Current white balance mode in string format, i.e. "Incandescent". |
- Remarks:
- Access to this property involves communication with the camera.
- See also:
- WhiteBalance(BSTR) for a description of the supported white balance modes.
|
| HRESULT ICamera::ZoomTeleStart |
( |
|
) |
|
|
|
|
Emulates T (tele zoom) button depression.
Must be followed by an invocation of ZoomTeleStop.
Included for graphical user interfaces based on kcamserver.
- Precondition:
- Camera in Serial mode with LCD turned on and in "Ready" state.
- Remarks:
- Invocation of this method involves communication with the camera.
|
| HRESULT ICamera::ZoomTeleStop |
( |
|
) |
|
|
|
|
Emulates T (tele zoom) button release.
Must be preceded by an invocation of ZoomTeleStart.
Included for graphical user interfaces based on kcamserver.
- Precondition:
- Camera in Serial mode with LCD turned on and in "Ready" state.
- Remarks:
- Invocation of this method involves communication with the camera.
|
| HRESULT ICamera::ZoomWideStart |
( |
|
) |
|
|
|
|
Emulates W (wide zoom) button depression.
Must be followed by an invocation of ZoomWideStop.
Included for graphical user interfaces based on kcamserver.
- Precondition:
- Camera in Serial mode with LCD turned on and in "Ready" state.
- Remarks:
- Invocation of this method involves communication with the camera.
|
| HRESULT ICamera::ZoomWideStop |
( |
|
) |
|
|
|
|
Emulates W (wide zoom) button release.
Must be preceded by an invocation of ZoomWideStart.
Included for graphical user interfaces based on kcamserver.
- Precondition:
- Camera in Serial mode with LCD turned on and in "Ready" state.
- Remarks:
- Invocation of this method involves communication with the camera.
|
This documentation was generated with doxygen.
|