public void SetLayeredWindowAttributes(byte?alpha, Color?colorKey = null) { LWA flags = 0; byte bAlpha = 0; uint crKey = 0; if (alpha != null) { bAlpha = alpha.Value; flags |= LWA.ALPHA; } if (colorKey != null) { uint r = (uint)colorKey.Value.R; uint g = (uint)colorKey.Value.G; uint b = (uint)colorKey.Value.B; crKey = r + (g << 8) + (b << 16); flags |= LWA.COLORKEY; } NativeMethods.SetLayeredWindowAttributes(_hwnd, crKey, bAlpha, flags); }
public static BOOL SetLayeredWindowAttributes(IHandle hwnd, int crKey, byte bAlpha, LWA dwFlags) { BOOL result = SetLayeredWindowAttributes(hwnd.Handle, crKey, bAlpha, dwFlags); GC.KeepAlive(hwnd); return(result); }
public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, byte alpha, LWA dwFlags);
public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, byte bAlpha, LWA dwFlags);
public static partial BOOL SetLayeredWindowAttributes(IntPtr hwnd, int crKey, byte bAlpha, LWA dwFlags);
internal static extern BOOL SetLayeredWindowAttributes(IntPtr hwnd, int crKey, byte bAlpha, LWA dwFlags);
public static extern bool SetLayeredWindowAttributes(HWND hwnd, uint crKey, byte bAlpha, LWA dwFlags);
public static extern bool SetLayeredWindowAttributes(IntPtr hwnd, COLORREF crKey, byte bAlpha, LWA dwFlags);
static extern Boolean SetLayeredWindowAttributes(IntPtr hWnd, int crKey, byte alpha, LWA dwFlags);
public static bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, int alpha, LWA dwFlags) => SetLayeredWindowAttributesNative(hWnd, crKey, alpha, dwFlags);
private static extern bool SetLayeredWindowAttributesNative(IntPtr hWnd, int crKey, int alpha, LWA dwFlags);