IntPtr current = faces;
for (int i = 0; i < count; i++)
{
- Marshal.PtrToStructure(current, faceStruct[i]);
+ faceStruct[i] = Marshal.PtrToStructure<Interop.Camera.DetectedFaceStruct>(current);
FaceDetectedData face = new FaceDetectedData(faceStruct[i].id, faceStruct[i].score, faceStruct[i].x, faceStruct[i].y, faceStruct[i].width, faceStruct[i].height);
_faces.Add(face);
current = (IntPtr)((long)current + Marshal.SizeOf(faceStruct[i]));
encodedData.TimeStamp = previewStruct.timestamp;
encodedData.Width = previewStruct.width;
Interop.Camera.EncodedPlane encodedPlane = previewStruct.frameData.encodedPlane;
- encodedData.Data = new byte[encodedPlane.size];\r
-\r
+ encodedData.Data = new byte[encodedPlane.size];
+
if (encodedPlane.size > 0)
Marshal.Copy(encodedPlane.data, encodedData.Data, 0, (int)encodedPlane.size);