mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-25 01:46:13 +02:00
- (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.
38 lines
1.2 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|