Example #1
0
        private void ProcessImage(WriteableBitmap writeable)
        {
            var smaller = writeable.MakeSmallerCopy(AppConstants.MaxDimensionForUpload);
            smaller.SaveToFile(AppConstants.UploadFileName, AppConstants.JpegQualityForUpload, (stream) => { });

            var api = new FaceRestAPI(AppConstants.FaceApikey, AppConstants.FaceSecretkey, "", false, "json", "", "");
            api.faces_detect(null,
                            AppConstants.UploadFileName,
                            null,
                            string.Empty,
                             (result) => Dispatcher.BeginInvoke(() => DisplayResult(writeable, result)),
                             (error) => Dispatcher.BeginInvoke(() =>
                                                                   {
                                                                       MessageBox.Show("Sorry - we had a problem: " + error);
                                                                       Debug.WriteLine("Bummer " + error);
                                                                       ShowDisplay(DisplayState.Intro);
                                                                   }));
        }