mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-12 11:32:33 +02:00
51c82318cf
- **Layer arithmetic:** - (Add) Allow to use ':' to define a layer range to set, eg, 0:20 to select from 0 to 20 layers - (Improvement) Modifications with set ROI and/or Mask(s) are only applied to target layer on that same regions - (Improvement) Disallow set one layer to the same layer without any modification - (Improvement) Clear and sanitize non-existing layers indexes - (Improvement) Disable the layer range selector from dialog - (Fix) Prevent error when using non-existing layers indexes - (Fix) Allow use only a mask for operations - (Fix) Implement the progress bar - **File formats:** - (Add) VDA.ZIP (Voxeldance Additive) - (Improvement) Add a check to global `LightPWM` if 0 it will force to 255 - (Improvement) Add a check to layer `LightPWM` if 0 it will force to 255 - (Add) Allow to save the selected region (ROI) to a image file - (Update) .NET 5.0.5 to 5.0.6 - (Fix) Getting the transposed rectangle in fliped images are offseting the position by -1 - (Fix) Tools: Hide ROI Region text when empty/not selected
37 lines
1.1 KiB
C#
37 lines
1.1 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.Drawing;
|
|
using Avalonia;
|
|
|
|
namespace UVtools.WPF.Extensions
|
|
{
|
|
public static class DrawingExtensions
|
|
{
|
|
public static Avalonia.Media.Color ToAvalonia(this System.Drawing.Color color)
|
|
{
|
|
return new(color.A, color.R, color.G, color.B);
|
|
}
|
|
|
|
public static System.Drawing.Color ToDotNet(this Avalonia.Media.Color color)
|
|
{
|
|
return Color.FromArgb(color.A, color.R, color.G, color.B);
|
|
}
|
|
|
|
public static Rect ToAvalonia(this Rectangle rectangle)
|
|
{
|
|
return new(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
|
}
|
|
|
|
public static Rectangle ToDotNet(this Rect rectangle)
|
|
{
|
|
return new((int) rectangle.X, (int) rectangle.Y, (int) rectangle.Width, (int) rectangle.Height);
|
|
}
|
|
}
|
|
}
|