Пример #1
0
        private void MainWindow_OnDragDrop(object sender, DragEventArgs e)
        {
            var dropChecker = new DragDropChecker();
            var imgbuff = dropChecker.CheckDrop(e);
            if (imgbuff == null)
                return;

            SelectedImage = imgbuff;
            MainImage.Source = SelectedImage.ImageSource;
        }
        private async void Upload(ImageBuff img)
        {
            var imgur = new Imgur();
            var link = await imgur.UploadAsync(img.ImageSource);

            ProcessingIndicator.IsActive = false;
            labelProgress.Content = "Uploaded Successful";
            tbURL.Text = link;
            tbURL.Visibility = Visibility.Visible;
            ButtonOk.Visibility = Visibility.Visible;
            imageUploaded.Source = new BitmapImage(new Uri(link));
        }
Пример #3
0
        private void PasteImage(object sernder, ExecutedRoutedEventArgs e)
        {
            if (!Clipboard.ContainsImage())
                return;

            var converter = new BitmapSourceToBitmapImageConverter();
            SelectedImage = new ImageBuff(converter.Convert(Clipboard.GetImage()), "Clipboard");
            MainImage.Source = SelectedImage.ImageSource;
        }
Пример #4
0
        private void OpenByDialog(object sender, ExecutedRoutedEventArgs e)
        {
            var openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = "*.jpg;*.png;*.gif;*.bmp;|*.jpg;*.png;*.gif;*.bmp;";
            openFileDialog.Multiselect = false;

            if (openFileDialog.ShowDialog() == false)
                return;

            SelectedImage = new ImageBuff(new BitmapImage(new Uri(openFileDialog.FileName)), openFileDialog.FileName);
        }
Пример #5
0
        private void Screencap(object sernder, ExecutedRoutedEventArgs e)
        {
            Hide();

            var captureWindow = new CaptureWindow();
            if (captureWindow.ShowDialog() == false)
            {
                Show();
                return;
            }

            SelectedImage = captureWindow.CapturedImage;
            MainImage.Source = SelectedImage.ImageSource;

            Show();
        }
 public UploadResultWindow(ImageBuff source)
 {
     InitializeComponent();
     Upload(source);
 }
        private void ButtonCapture_OnClick(object sender, RoutedEventArgs e)
        {
            Opacity = 0;

            var location = GetThisLocation();
            var size = GetThisSize();

            var capture = new Screencap();
            CapturedImage = capture.Capture(location, size);

            Opacity = 1;
            DialogResult = true;
        }