Tag: gimp

将图像加载到MenuItem上会使预乘的alpha图像失去透明度

我真的需要一些帮助。 我正在尝试将一个我认为32bpp的图像加载到MenuItem上的预乘alpha( 我按照本指南在GIMP中制作图像 )。 我知道ContextMenuStrip类,不想使用它。 以下是我用于将图像设置到MenuItem上的代码: // apis [DllImport(“user32.dll”, SetLastError = true)] static extern bool SetMenuItemInfo(IntPtr hMenu, uint uItem, bool fByPosition, [In] ref MENUITEMINFO lpmii); [DllImport(“user32.dll”, SetLastError = true, CharSet = CharSet.Auto)] static extern IntPtr LoadImage(IntPtr hinst, string lpszName, uint uType, int cxDesired, int cyDesired, uint fuLoad); // structures [StructLayout(LayoutKind.Sequential)] struct MENUITEMINFO { public uint […]