44 lines
1.2 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|