Removed the rest of CS Script and removed old plugin projects

This commit is contained in:
Robert Beekman committed 2019-04-10 16:05:19 +02:00
1 parent aa32c8aae4
commit 90cd27b0c6
47 files changed
+550 -846

No files matched your search

+24 -24
View File
@@ -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;
}
}
}