mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Removed the rest of CS Script and removed old plugin projects
This commit is contained in:
1 parent
aa32c8aae4
commit
90cd27b0c6
47 files changed
+550
-846
No files matched your search
@@ -7,39 +7,22 @@ namespace Artemis.Core.RGB.NET
|
||||
{
|
||||
public class DirectBitmap : IDisposable
|
||||
{
|
||||
public Bitmap Bitmap { get; private set; }
|
||||
public Int32[] Bits { get; private set; }
|
||||
public bool Disposed { get; private set; }
|
||||
public int Height { get; private set; }
|
||||
public int Width { get; private set; }
|
||||
|
||||
protected GCHandle BitsHandle { get; private set; }
|
||||
|
||||
public DirectBitmap(int width, int height)
|
||||
{
|
||||
Width = width;
|
||||
Height = height;
|
||||
Bits = new Int32[width * height];
|
||||
Bits = new int[width * height];
|
||||
BitsHandle = GCHandle.Alloc(Bits, GCHandleType.Pinned);
|
||||
Bitmap = new Bitmap(width, height, width * 4, PixelFormat.Format32bppPArgb, BitsHandle.AddrOfPinnedObject());
|
||||
}
|
||||
|
||||
public void SetPixel(int x, int y, Color colour)
|
||||
{
|
||||
int index = x + (y * Width);
|
||||
int col = colour.ToArgb();
|
||||
public Bitmap Bitmap { get; }
|
||||
public int[] Bits { get; }
|
||||
public bool Disposed { get; private set; }
|
||||
public int Height { get; }
|
||||
public int Width { get; }
|
||||
|
||||
Bits[index] = col;
|
||||
}
|
||||
|
||||
public Color GetPixel(int x, int y)
|
||||
{
|
||||
int index = x + (y * Width);
|
||||
int col = Bits[index];
|
||||
Color result = Color.FromArgb(col);
|
||||
|
||||
return result;
|
||||
}
|
||||
protected GCHandle BitsHandle { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
@@ -48,5 +31,22 @@ namespace Artemis.Core.RGB.NET
|
||||
Bitmap.Dispose();
|
||||
BitsHandle.Free();
|
||||
}
|
||||
|
||||
public void SetPixel(int x, int y, Color colour)
|
||||
{
|
||||
var index = x + y * Width;
|
||||
var col = colour.ToArgb();
|
||||
|
||||
Bits[index] = col;
|
||||
}
|
||||
|
||||
public Color GetPixel(int x, int y)
|
||||
{
|
||||
var index = x + y * Width;
|
||||
var col = Bits[index];
|
||||
var result = Color.FromArgb(col);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Groups;
|
||||
using Color = RGB.NET.Core.Color;
|
||||
@@ -17,7 +16,7 @@ namespace Artemis.Core.RGB.NET
|
||||
// var height = ledGroup.GetLeds().Max(l => l.LedRectangle.Y + l.LedRectangle.Height);
|
||||
var width = 500;
|
||||
var height = 500;
|
||||
_bitmap = new DirectBitmap((int) width, (int) height);
|
||||
_bitmap = new DirectBitmap(width, height);
|
||||
}
|
||||
|
||||
public Color ManipulateColor(Rectangle rectangle, BrushRenderTarget renderTarget, Color color)
|
||||
|
||||
Reference in new issue
Block a user