Пример #1
0
        private void GaintextBox_TextChanged(object sender, EventArgs e)
        {
            if (myGainNode != null)
            {
                double value = Convert.ToSingle(GaintextBox.Text);
                myGainNode.Value = value;
                if (null == myCamera)
                {
                    return;
                }

                IntPtr hDevice = IntPtr.Zero;
                Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.J_Camera_GetLocalDeviceHandle(myCamera.CameraHandle, ref hDevice);
                if (Jai_FactoryWrapper.EFactoryError.Success != error)
                {
                    return;
                }

                if (IntPtr.Zero == hDevice)
                {
                    return;
                }

                IntPtr hNode;
                error = Jai_FactoryWrapper.J_Camera_GetNodeByName(hDevice, "Gain", out hNode);
                if (Jai_FactoryWrapper.EFactoryError.Success != error)
                {
                    return;
                }

                if (IntPtr.Zero == hNode)
                {
                    return;
                }

                Jai_FactoryWrapper.J_Node_SetValueDouble(hNode, false, value);
            }
        }