PDA

View Full Version : Problem with WhiteBalanceGreen



NicoT
March 8, 2011, 09:14:43
Hi,

I have some problem to acces to the "WhiteBalanceGreen" feature with DFK 72AUC02 camera :

With DemoApp (exe) the feature is available, with DemoApp.cs the feature is available, but when i'am using the function "VCDProp.Available(VCDIDs.VCDElement_WhiteBalanceGr een)", the feature is not available !!
Red and Blue are OK. Any idea ?

Programm in C# with Visual studio 2008.

Best Regards.

NicoT

Michael Kirmse
March 8, 2011, 10:31:52
Hi NicoT,

to access the WhiteBalanceGreen, you have to define a VCDPropertyItem and a VCDRangeProperty like this:

private TIS.Imaging.VCDPropertyItem WhiteBalance = null;
private TIS.Imaging.VCDRangeProperty WhiteBalanceGreen = null;

You get the WhiteBalance property item by using this code:

WhiteBalance = icImagingControl1.VCDPropertyItems.FindItem(TIS.Im aging.VCDIDs.VCDID_WhiteBalance);

and to access the WhiteBalanceGreen, you have to do this:

WhiteBalanceGreen = (TIS.Imaging.VCDRangeProperty)WhiteBalance.Element s.FindInterface(TIS.Imaging.VCDIDs.VCDElement_Whit eBalanceGreen + ":" + TIS.Imaging.VCDIDs.VCDInterface_Range);

Now you can easily use the WhiteBalanceGreen property like this:

if (WhiteBalanceGreen != null)
{
WhiteBalanceGreen.Value = 255;
}

NicoT
March 8, 2011, 12:43:48
Thank's for your response.

In my code the function

" VCDProp.Available(VCDIDs.VCDElement_WhiteBalanceRe d) " return TRUE
but "VCDProp.Available(VCDIDs.VCDElement_WhiteBalanceGr een) return FALSE !!

Stefan Geissler
March 8, 2011, 13:14:21
I think this is a problem of an early implementation of the VCDSimplyProperty Class. The "Green" was introduced with IC Imaging Control 3.1. As far as I know, it was not available in IC Imaging Control 3.0.

However, did you try the code posted above? This is the correct way to query the white balance green property using IC Imaging Contorl 3.1.

NicoT
March 8, 2011, 14:18:19
However, did you try the code posted above? This is the correct way to query the white balance green property using IC Imaging Contorl 3.1.


Hi Stephan,

I take your sample "VCD Simple Property" (D:\MesDocuments\IC Imaging Control 3.1\samples\C# 2008\VCD Simple Property), and i change :



if (!VCDProp.Available(VCDIDs.VCDElement_WhiteBalance Green))
WhiteBalBlueTrackBar.Enabled = false; <-- my program go here !!
else
{
WhiteBalBlueTrackBar.Enabled = true;
WhiteBalBlueTrackBar.Minimum = VCDProp.RangeMin(VCDIDs.VCDElement_WhiteBalanceGre en);
WhiteBalBlueTrackBar.Maximum = VCDProp.RangeMax(VCDIDs.VCDElement_WhiteBalanceGre en);
WhiteBalBlueTrackBar.Value = VCDProp.RangeValue[VCDIDs.VCDElement_WhiteBalanceGreen];
WhiteBalBlueTrackBar.TickFrequency = (WhiteBalBlueTrackBar.Maximum - WhiteBalBlueTrackBar.Minimum) / 10;
WhiteBalBlueLabel.Text = WhiteBalBlueTrackBar.Value.ToString();
}


And i'am using the 3.1 version.

Stefan Geissler
March 8, 2011, 15:13:31
In my last post, I already wrote an answer to your last answer.

NicoT
March 9, 2011, 14:34:13
Hi NicoT,

to access the WhiteBalanceGreen, you have to define a VCDPropertyItem and a VCDRangeProperty like this:

private TIS.Imaging.VCDPropertyItem WhiteBalance = null;
private TIS.Imaging.VCDRangeProperty WhiteBalanceGreen = null;

You get the WhiteBalance property item by using this code:

WhiteBalance = icImagingControl1.VCDPropertyItems.FindItem(TIS.Im aging.VCDIDs.VCDID_WhiteBalance);

and to access the WhiteBalanceGreen, you have to do this:

WhiteBalanceGreen = (TIS.Imaging.VCDRangeProperty)WhiteBalance.Element s.FindInterface(TIS.Imaging.VCDIDs.VCDElement_Whit eBalanceGreen + ":" + TIS.Imaging.VCDIDs.VCDInterface_Range);

Now you can easily use the WhiteBalanceGreen property like this:

if (WhiteBalanceGreen != null)
{
WhiteBalanceGreen.Value = 255;
}



It's Ok with this code but it's wrong in the sample "VCD Simple Property".

Stefan Geissler
March 9, 2011, 15:01:39
It's Ok with this code but it's wrong in the sample "VCD Simple Property".

Yes, because the VCD Simply Property class was made before the White Balance Green property was invented. The White Balance properties are handled in the different way than the other properties like brightness and gain.