Implemented most of the rendering pipeline in SkiaSharp

This commit is contained in:
SpoinkyNL committed 2019-12-03 00:09:32 +01:00
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()
);
}
}