Remove obsolete code.

This commit is contained in:
Paul Chote
2019-02-17 23:41:39 +00:00
committed by reaperrr
parent 5a1124426d
commit 94f7f6fd2e
8 changed files with 0 additions and 65 deletions

View File

@@ -12,10 +12,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
namespace OpenRA.Graphics
{
@@ -36,30 +33,6 @@ namespace OpenRA.Graphics
return Color.FromArgb((int)palette[index]);
}
public static ColorPalette AsSystemPalette(this IPalette palette)
{
ColorPalette pal;
using (var b = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
pal = b.Palette;
for (var i = 0; i < Size; i++)
pal.Entries[i] = palette.GetColor(i);
return pal;
}
public static Bitmap AsBitmap(this IPalette palette)
{
var b = new Bitmap(Size, 1, PixelFormat.Format32bppArgb);
var data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
var temp = new uint[Size];
palette.CopyToArray(temp, 0);
Marshal.Copy((int[])(object)temp, 0, data.Scan0, Size);
b.UnlockBits(data);
return b;
}
public static IPalette AsReadOnly(this IPalette palette)
{
if (palette is ImmutablePalette)