private void DrawData(Affdex.Frame image, Dictionary<int, Affdex.Face> faces)
{
try
{
// Plot Face Points
if (faces != null)
{
var result = this.Dispatcher.BeginInvoke((Action)(() =>
{
if ((Detector != null) && (Detector.isRunning()))
{
canvas.Faces = faces;
canvas.Width = cameraDisplay.ActualWidth;
canvas.Height = cameraDisplay.ActualHeight;
canvas.XScale = canvas.Width / image.getWidth();
canvas.YScale = canvas.Height / image.getHeight();
canvas.InvalidateVisual();
DrawSkipCount = 0;
}
}));
}
}
catch(Exception ex)
{
String message = String.IsNullOrEmpty(ex.Message) ? "AffdexMe error encountered." : ex.Message;
ShowExceptionAndShutDown(message);
}
}