mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Implemented most of the rendering pipeline in SkiaSharp
This commit is contained in:
1 parent
b8a678c97f
commit
96a057df23
35 files changed
+234
-274
No files matched your search
@@ -1,16 +1,17 @@
|
||||
using System.Drawing;
|
||||
using RGB.NET.Core;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Artemis.Core.Extensions
|
||||
{
|
||||
public static class RgbRectangleExtensions
|
||||
{
|
||||
public static Rectangle ToDrawingRectangle(this global::RGB.NET.Core.Rectangle rectangle, double scale)
|
||||
public static SKRect ToSKRect(this Rectangle rectangle, double scale)
|
||||
{
|
||||
return new Rectangle(
|
||||
(int) (rectangle.Location.X * scale),
|
||||
(int) (rectangle.Location.Y * scale),
|
||||
(int) (rectangle.Size.Width * scale),
|
||||
(int) (rectangle.Size.Height * scale)
|
||||
return SKRect.Create(
|
||||
(rectangle.Location.X * scale).RoundToInt(),
|
||||
(rectangle.Location.Y * scale).RoundToInt(),
|
||||
(rectangle.Size.Width * scale).RoundToInt(),
|
||||
(rectangle.Size.Height * scale).RoundToInt()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user