예제 #1
0
 public void list()
 {
     var files = Directory.GetDirectories(_name);
     files.ToList().ForEach((name) => {
         var sender = new ImageSender(name);
         Directory.GetFiles(name).ToList().ForEach((imageName) => {
             sender.addImage(Image.FromFile(imageName));
         });
         sender.send();
     });
 }
예제 #2
0
        private async void CaptureImageButton_Click(object sender, RoutedEventArgs e)
        {
            Success.Visibility = Visibility.Hidden;                                                 // Changing supplementary text visibility
            Failure.Visibility = Visibility.Hidden;                                                 // Changing supplementary text visibility

            var image = await ImageSender.CaptureImage();                                           // Capturing image, return image matrix

            if (DisplayImage(image) == 0)                                                           // Displaying image to main window of application
            {
                Success.Visibility = Visibility.Visible;                                            // Changing supplementary text visibility
            }
            else
            {
                Failure.Visibility = Visibility.Visible;                                               // Changing supplementary text visibility
            }
        }
예제 #3
0
        private async void UploadImageButton_Click(object sender, RoutedEventArgs e)
        {
            Success.Visibility = Visibility.Hidden;                                                    // Changing supplementary text visibility
            Failure.Visibility = Visibility.Hidden;                                                    // Changing supplementary text visibility

            OpenFileDialog openFile = new OpenFileDialog {
                Filter = "Image files (*.jpg) | *.jpg"
            };                                                // Windows 10 Open File functionality

            if (openFile.ShowDialog() == true)                // If user chooses a file
            {
                File.Copy(openFile.FileName, FilePath, true); // Copy file contents from location to project destination
            }
            if (await ImageSender.UploadImage() == 0)
            {
                Success.Visibility = Visibility.Visible;                                               // Changing supplementary text visibility
            }
            else
            {
                Failure.Visibility = Visibility.Visible;                                               // Changing supplementary text visibility
            }
            DisplayImage(openFile);                                                                    // Displaying image to main window of application
        }