mirror of
https://github.com/claunia/libexeinfo.git
synced 2025-12-16 19:14:24 +00:00
Add full support for Gem color icons.
This commit is contained in:
19
exeinfogui/GEM/GemColorIcon.cs
Normal file
19
exeinfogui/GEM/GemColorIcon.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user