blob: 17f02cf6d207833e6b9e8ad8ac41cd326f2711a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using UVtools.Core.Operations;
namespace UVtools.WPF.Controls.Tools
{
public class ToolPixelDimmingControl : ToolControl
{
public OperationPixelDimming Operation => BaseOperation as OperationPixelDimming;
public ToolPixelDimmingControl()
{
BaseOperation = new OperationPixelDimming(SlicerFile);
if (!ValidateSpawn()) return;
InitializeComponent();
Operation.GeneratePixelDimming("Chessboard");
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public async void LoadPatternFromImage(bool isAlternatePattern = false)
{
var dialog = new OpenFileDialog
{
AllowMultiple = false,
Filters = Helpers.ImagesFileFilter,
};
var files = await dialog.ShowAsync(ParentWindow);
if (files is null || files.Length == 0) return;
Operation.LoadPatternFromImage(files[0], isAlternatePattern);
}
}
}
|