Files
UVtools/UVtools.WPF/Controls/Tools/ToolLayerExportHeatMapControl.axaml.cs
T
Tiago Conceição ad92a0aa5c v2.12.2
- (Add) Layer action - Export layers to heat map: Export a layer range to a grayscale heat map image that represents the median of the mass in the Z depth/perception. The pixel brightness/intensity shows where the most mass are concentrated.
2021-05-20 05:12:18 +01:00

38 lines
1.2 KiB
C#

using System.Collections.Generic;
using System.IO;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using UVtools.Core.Operations;
namespace UVtools.WPF.Controls.Tools
{
public partial class ToolLayerExportHeatMapControl : ToolControl
{
public OperationLayerExportHeatMap Operation => BaseOperation as OperationLayerExportHeatMap;
public ToolLayerExportHeatMapControl()
{
InitializeComponent();
BaseOperation = new OperationLayerExportHeatMap(SlicerFile);
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public async void ChooseFilePath()
{
var dialog = new SaveFileDialog
{
Filters = Helpers.ImagesFullFileFilter,
InitialFileName = Path.GetFileName(SlicerFile.FileFullPath) + ".heatmap.png",
Directory = Path.GetDirectoryName(SlicerFile.FileFullPath),
};
var file = await dialog.ShowAsync(ParentWindow);
if (string.IsNullOrWhiteSpace(file)) return;
Operation.FilePath = file;
}
}
}