public async void TestAI(object sender, RoutedEventArgs e) { Button button = sender as Button; StackPanel stackPanel = button.Parent as StackPanel; CheckBox checkBox = stackPanel.Children.OfType <CheckBox>().First(); Image image = stackPanel.Children.OfType <Image>().First(); if (checkBox.Content.ToString() == "百度人脸识别") { string base64 = "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCADIAJMDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD0bxeudbj/AOvdf/QmrFEY9PrW94sGdZj/AOvdf/QmrFxXfS+BHnVfjZxvxCuFsPDjJDxcXb+Uv+73rxSSQ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UWQ+Zm9F8OdMi1GK8F3ds8bb1ViuM/wDfNaX/AAidjv3lpN+NpOF5H5UUVDowluivbVO5W/4QLRGfe1rEzH+I28Wfz21bTwjpCWX2M2kTW+NvlGNdv5YxRRSVGEdkJ1ZPqZtn8PNI0/U9MvLOW6gj05ZlhtlcGP8Aefe6jPc9DUeq/D6LWbkT3et6mdru0cSmMIikgqoXZjCgYB688k0UVairWEqkk9zI034M6RpevHWodZ1Z70q6lneMg7l2n+D0NVrr4GaJeb/tGs6u6sSSA0QHP/bOiiqsg9pLueqUUUUEn//Z"; System.Drawing.Bitmap bitmap = ImageProcess.Base64ToBitmap(base64); Dictionary <string, string> result; Int32Rect int32Rect; (result, int32Rect) = await TestBaiduAI(bitmap); if (result != null && int32Rect != Int32Rect.Empty) { image.Source = new BitmapImage(new Uri(@"/Resources/Picture/status_success.png", UriKind.Relative)); new PopupWindow(this, "成功!").Show(); } else { image.Source = new BitmapImage(new Uri(@"/Resources/Picture/status_fail.png", UriKind.Relative)); new PopupWindow(this, "失败!").Show(); } } }
public async void TestAI(object sender, RoutedEventArgs e) { Button button = sender as Button; StackPanel stackPanel = button.Parent as StackPanel; CheckBox checkBox = stackPanel.Children.OfType <CheckBox>().First(); ImageAwesome imageAwesome = stackPanel.Children.OfType <ImageAwesome>().First(); imageAwesome.Icon = FontAwesomeIcon.Refresh; imageAwesome.Spin = true; imageAwesome.Foreground = (SolidColorBrush)Application.Current.Resources["ForegroundSearch"]; if (checkBox.Content.ToString() == Jvedio.Language.Resources.BaiduFaceRecognition) { string base64 = Resource_String.BaseImage64; System.Drawing.Bitmap bitmap = ImageProcess.Base64ToBitmap(base64); Dictionary <string, string> result; Int32Rect int32Rect; (result, int32Rect) = await TestBaiduAI(bitmap); if (result != null && int32Rect != Int32Rect.Empty) { imageAwesome.Icon = FontAwesomeIcon.CheckCircle; imageAwesome.Spin = false; imageAwesome.Foreground = new SolidColorBrush(Color.FromRgb(32, 183, 89)); string clientId = Properties.Settings.Default.Baidu_API_KEY.Replace(" ", ""); string clientSecret = Properties.Settings.Default.Baidu_SECRET_KEY.Replace(" ", ""); SaveKeyValue(clientId, clientSecret, "BaiduAI.key"); } else { imageAwesome.Icon = FontAwesomeIcon.TimesCircle; imageAwesome.Spin = false; imageAwesome.Foreground = new SolidColorBrush(Colors.Red); } } }