Add full support for Gem color icons.

This commit is contained in:
2018-03-01 16:33:04 +00:00
parent e4a20f73af
commit d7b2df59b1
14 changed files with 875 additions and 230 deletions

View File

@@ -0,0 +1,19 @@
using Eto.Drawing;
namespace exeinfogui.GEM
{
public static class GemColorIcon
{
public static Bitmap GemColorIconToEto(libexeinfo.GEM.ColorIconPlane icon, int width, int height, bool selected)
{
if(selected && icon.SelectedData == null) return null;
byte[] data = selected ? icon.SelectedData : icon.Data;
byte[] mask = selected ? icon.SelectedMask : icon.Mask;
int[] pixels = libexeinfo.GEM.PlaneToRaster(data, mask, width, height, icon.Planes);
return new Bitmap(width, height, PixelFormat.Format32bppRgba, pixels);
}
}
}