mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-08-01 21:32:18 +02:00
* (Add) About box: Primary screen identifier and open on screen identifier * (Add) Calibrator - External tests * (Change) Rewrite 'Action - Import Layer(s)' to support file formats and add the followig importation types: * **Insert:** Insert layers. (Requires images with bounds equal or less than file resolution) * **Replace:** Replace layers. (Requires images with bounds equal or less than file resolution) * **Stack:** Stack layers content. (Requires images with bounds equal or less than file resolution) * **Merge:** Merge/Sum layers content. (Requires images with same resolution) * **Subtract:** Subtract layers content. (Requires images with same resolution) * **BitwiseAnd:** Perform a 'bitwise and' operation over layer pixels. (Requires images with same resolution) * **BitwiseOr:** Perform a 'bitwise or' operation over layer pixels. (Requires images with same resolution) * **BitwiseXOr:** Perform a 'bitwise xor' operation over layer pixels. (Requires images with same resolution) * (Change) Icon for Tool - Raft Relief * (Change) Windows and dialogs max size are now calculated to where window is opened instead of use the primary or first screen all the time
84 lines
2.4 KiB
C#
84 lines
2.4 KiB
C#
/*
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE
|
|
* Version 3, 19 November 2007
|
|
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
* Everyone is permitted to copy and distribute verbatim copies
|
|
* of this license document, but changing it is not allowed.
|
|
*/
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Avalonia.Controls;
|
|
|
|
namespace UVtools.WPF.Controls
|
|
{
|
|
public static class Helpers
|
|
{
|
|
public static readonly List<FileDialogFilter> ImagesFileFilter = new()
|
|
{
|
|
new FileDialogFilter
|
|
{
|
|
Name = "Image Files",
|
|
Extensions = new List<string>
|
|
{
|
|
"png",
|
|
"bmp",
|
|
"jpeg",
|
|
"jpg",
|
|
"gif"
|
|
}
|
|
}
|
|
};
|
|
|
|
public static readonly List<FileDialogFilter> PngFileFilter = new List<FileDialogFilter>
|
|
{
|
|
new FileDialogFilter
|
|
{
|
|
Name = "Image Files",
|
|
Extensions = new List<string>
|
|
{
|
|
"png",
|
|
}
|
|
}
|
|
};
|
|
|
|
public static readonly List<FileDialogFilter> TxtFileFilter = new List<FileDialogFilter>
|
|
{
|
|
new FileDialogFilter
|
|
{
|
|
Name = "Text Files",
|
|
Extensions = new List<string>
|
|
{
|
|
"txt",
|
|
}
|
|
}
|
|
};
|
|
|
|
public static readonly List<FileDialogFilter> IniFileFilter = new List<FileDialogFilter>
|
|
{
|
|
new FileDialogFilter
|
|
{
|
|
Name = "Ini Files",
|
|
Extensions = new List<string>
|
|
{
|
|
"ini",
|
|
}
|
|
}
|
|
};
|
|
|
|
public static List<FileDialogFilter> ToAvaloniaFileFilter(List<KeyValuePair<string, List<string>>> data)
|
|
{
|
|
var result = new List<FileDialogFilter>(data.Capacity);
|
|
result.AddRange(data.Select(kv => new FileDialogFilter {Name = kv.Key, Extensions = kv.Value}));
|
|
return result;
|
|
}
|
|
|
|
public static List<FileDialogFilter> ToAvaloniaFilter(string name, string extension)
|
|
{
|
|
return new List<FileDialogFilter>(1)
|
|
{
|
|
new FileDialogFilter {Name = name, Extensions = new List<string>(1) {extension}}
|
|
};
|
|
}
|
|
}
|
|
}
|