简体   繁体   中英

C# Output Console - “System.Collection.Generic.Dictionary2+ValueCollection” Kinect v2

I am new in c# and i have a problem with console output. I have include using System and using System.IO But when i print something in console output i don't see nothing. If i write:

`Console.WriteLine("AAAAAAA");`

But I don't see AAAAAAAA... why?

I am in kinect FaceBasic code: And i want print a variable. (the FaceFrameResults values)

The variable is FaceFrameResult.FacePointsInInfraredSpace Property.

Type: IReadOnlyDictionary<FacePointType, Point>

( http://msdn.microsoft.com/en-us/library/hh136548.aspx )

I want to print this with this code:

Console.WriteLine("Key = {0}, Value = {1}",faceFrame.FaceFrameResult.FacePointsInColorSpace.Keys,faceFrame.FaceFrameResult.FacePointsInColorSpace.Values);

But nothing happens, and does not give me any errors or warnings. If i try to print the value using messagebox

`MessageBox.Show(faceFrameResults[index].FacePointsInInfraredSpace.Values.ToString());`
`MessageBox.Show(faceFrameResults[index].FacePointsInInfraredSpace.Values);`

I obtain this:

System.Collection.Generic.Dictionary'2+ValueCollection[Microsoft.Kinect.Face.FacePointType.Microsoft.Kinect.PointF]

Which is the problem? Thank you in advance for your reply!

You are trying to print out a collection, you can't do this directly, you need to iterate over the collection and print out each item one by one. eg

foreach(var kvp in faceFrame.FaceFrameResult.FacePointsInColorSpace)
{
    Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM