diff --git a/OpenRA.Game/Exts.cs b/OpenRA.Game/Exts.cs index 8e510e286b..78c5006283 100644 --- a/OpenRA.Game/Exts.cs +++ b/OpenRA.Game/Exts.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Drawing.Imaging; using System.Globalization; using System.Linq; using System.Reflection; @@ -448,8 +447,6 @@ namespace OpenRA return result; } - public static Rectangle Bounds(this Bitmap b) { return new Rectangle(0, 0, b.Width, b.Height); } - public static int ToBits(this IEnumerable bits) { var i = 0; diff --git a/OpenRA.Game/FieldLoader.cs b/OpenRA.Game/FieldLoader.cs index 408e6d4ed8..7041d75c34 100644 --- a/OpenRA.Game/FieldLoader.cs +++ b/OpenRA.Game/FieldLoader.cs @@ -13,7 +13,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; -using System.Drawing.Imaging; using System.Globalization; using System.IO; using System.Linq; @@ -450,29 +449,6 @@ namespace OpenRA return InvalidValueAction(value, fieldType, fieldName); } } - else if (fieldType == typeof(ImageFormat)) - { - if (value != null) - { - switch (value.ToLowerInvariant()) - { - case "bmp": - return ImageFormat.Bmp; - case "gif": - return ImageFormat.Gif; - case "jpg": - case "jpeg": - return ImageFormat.Jpeg; - case "tif": - case "tiff": - return ImageFormat.Tiff; - default: - return ImageFormat.Png; - } - } - - return InvalidValueAction(value, fieldType, fieldName); - } else if (fieldType == typeof(bool)) return ParseYesNo(value, fieldType, fieldName); else if (fieldType == typeof(int2[])) diff --git a/OpenRA.Game/FieldSaver.cs b/OpenRA.Game/FieldSaver.cs index 3f3157c660..38ca413931 100644 --- a/OpenRA.Game/FieldSaver.cs +++ b/OpenRA.Game/FieldSaver.cs @@ -13,7 +13,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; -using System.Drawing.Imaging; using System.Globalization; using System.Linq; using System.Reflection; @@ -88,11 +87,6 @@ namespace OpenRA return ((HSLColor)v).ToHexString(); } - if (t == typeof(ImageFormat)) - { - return ((ImageFormat)v).ToString(); - } - if (t == typeof(Rectangle)) { var r = (Rectangle)v; diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 89bf641b1d..8d9f665db2 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -13,7 +13,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; -using System.Drawing.Imaging; using System.Globalization; using System.IO; using System.Linq; diff --git a/OpenRA.Game/Graphics/Palette.cs b/OpenRA.Game/Graphics/Palette.cs index ef8323fbea..8e7f238b61 100644 --- a/OpenRA.Game/Graphics/Palette.cs +++ b/OpenRA.Game/Graphics/Palette.cs @@ -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) diff --git a/OpenRA.Game/Graphics/Util.cs b/OpenRA.Game/Graphics/Util.cs index 97ad3f263e..d254474eb6 100644 --- a/OpenRA.Game/Graphics/Util.cs +++ b/OpenRA.Game/Graphics/Util.cs @@ -11,7 +11,6 @@ using System; using System.Drawing; -using System.Drawing.Imaging; using OpenRA.FileFormats; namespace OpenRA.Graphics diff --git a/OpenRA.Mods.Common/UtilityCommands/ConvertSpriteToPngCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ConvertSpriteToPngCommand.cs index df4f6a1175..82cddb69c5 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ConvertSpriteToPngCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ConvertSpriteToPngCommand.cs @@ -11,10 +11,8 @@ using System; using System.Drawing; -using System.Drawing.Imaging; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Primitives; diff --git a/OpenRA.Mods.Common/Widgets/HueSliderWidget.cs b/OpenRA.Mods.Common/Widgets/HueSliderWidget.cs index 3ca015edcf..47a72c5e61 100644 --- a/OpenRA.Mods.Common/Widgets/HueSliderWidget.cs +++ b/OpenRA.Mods.Common/Widgets/HueSliderWidget.cs @@ -10,7 +10,6 @@ #endregion using System.Drawing; -using System.Drawing.Imaging; using OpenRA.Graphics; using OpenRA.Widgets;