- Posts: 38
- Joined: Sun Jan 12, 2014 4:56 pm
Try working with unmanaged code for this task:
- Code: Select all
double[] readLiftAdjust = new double[4];
IntPtr readLiftAdjustPtr = Marshal.AllocHGlobal(Marshal.SizeOf(readLiftAdjust[0]) * readLiftAdjust.Length);
try
{
unsafe
{
double* readLiftAdjustDeref = (double*)readLiftAdjustPtr.ToPointer();
cameraControl.GetFloats(
cameraNumber, // Camera number
8, // Color Correction
0, // Lift Adjust
(uint)readLiftAdjust.Length, // Array size
out *readLiftAdjustDeref // Single element array with the desired value
);
}
Marshal.Copy(readLiftAdjustPtr, readLiftAdjust, 0, readLiftAdjust.Length);
}
finally
{
Marshal.FreeHGlobal(readLiftAdjustPtr);
}
Cameron