This repository has been archived on 2024-06-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
thesis-src/Examples/GUI/Views/ImageView.xaml.cs
2023-08-10 09:04:36 +02:00

44 lines
1.2 KiB
C#

using GUI.ViewModels;
using ImageMagick;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
namespace GUI.Views
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class ImageView : Window
{
public ImageView()
{
DataContext = new ImageViewModel();
InitializeComponent();
}
public ImageView(MagickImage image)
{
DataContext = new ImageViewModel(image);
InitializeComponent();
}
private void SldThreshold1_OnDragCompleted(object sender, DragCompletedEventArgs args)
{
((ImageViewModel)DataContext).ImageProcessorConfiguration.ThresholdWidth = (int)Math.Round(((Slider)sender).Value);
}
private void SldThreshold2_OnDragCompleted(object sender, DragCompletedEventArgs args)
{
((ImageViewModel)DataContext).ImageProcessorConfiguration.ThresholdHeight = (int)Math.Round(((Slider)sender).Value);
}
private void SldBorder_OnDragCompleted(object sender, DragCompletedEventArgs e)
{
((ImageViewModel)DataContext).ImageProcessorConfiguration.Border = (int)Math.Round(((Slider)sender).Value);
}
}
}