Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, byte alpha, LWA dwFlags);
Пример #4
0
 public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, byte bAlpha, LWA dwFlags);
Пример #5
0
 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);
Пример #7
0
 public static extern bool SetLayeredWindowAttributes(HWND hwnd, uint crKey, byte bAlpha, LWA dwFlags);
 public static extern bool SetLayeredWindowAttributes(HWND hwnd, uint crKey, byte bAlpha, LWA dwFlags);
Пример #9
0
 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);
Пример #11
0
 public static bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, int alpha, LWA dwFlags) => SetLayeredWindowAttributesNative(hWnd, crKey, alpha, dwFlags);
Пример #12
0
 private static extern bool SetLayeredWindowAttributesNative(IntPtr hWnd, int crKey, int alpha, LWA dwFlags);