View Full Version : Using VCD Properties with Delphi (V5)

February 12, 2008, 15:07:47

I've just purchased a DMK 31AF03.AS camera for astronomy purposes.
I'm developing a plugin for TIS cameras, in order to use them in an astronomical webcam imaging software that I have been developing for these past 6 years.

I'm using the ICImagingControl ActiveX component, and I need to have direct access to the exposure property of the component. The problem is that I cannot obtain exposures longer than 1 second. So I'm trying to use the
VCDID_Brightness property, like explained in the http://www.imagingcontrol.com/support/documentation/activex/vcdsimple.htm link.

I've converted the VCDPropertyID.bas header file into Delphi.
My problem is that when I call the FindItem method, like this :

Procedure TestBrightness;
Brightness : VCDPropertyItem;
BrightnessRange :VCDRangeProperty;
BrightnessSwitch :VCDSwitchProperty;

Brightness := ICImagingControl1.VCDPropertyItems.FindItem(VCDID_ Brightness);
If Brightness <> nil Then
// Get interfaces which allow to manipulate the property.
BrightnessRange := Brightness.Elements.FindInterface(VCDElement_Value + ':' + VCDInterface_Range);
BrightnessSwitch := Brightness.Elements.FindInterface(VCDElement_Auto + ':' + VCDInterface_Switch);

// rest of the procedure


The Brightness variable is always nil, instead of containing the expected GUID identifier, and this whatever the requested property.

Am I missing something ?
Would I be better off creating another delphi unit with TGUID type constants instead of the widestring values that are declared in the VCDPropertyID.bas, and using directly the TGUID constants without using the VCDPropertyItems.FindItem method ?

Thank in advance you for your help.

Axel Canicio

Stefan Geissler
February 12, 2008, 15:16:09
Hi Axel,

I attached a Delphi VCD sample to this post. I hope, it is helpful for you. If not, please ask.

February 12, 2008, 15:28:39
Dear Stefan,

WOW !!!
This is fast !
Thank you for your lightning-like answer.
I had not even finished typing my question :-)

Best regards