예제 #1
0
        /// <summary>
        /// ウィンドウ透過をON/OFF
        /// </summary>
        public void EnableTransparent(bool enable)
        {
            if (!IsActive)
            {
                return;
            }

            if (enable)
            {
                // 現在のウィンドウ情報を記憶
                StoreWindowSize();

                // 枠無しウィンドウにする
                EnableBorderless(true);

                switch (TransparentMethod)
                {
                case TransparentType.DWM:
                    EnableTransparentByDWM();
                    break;

                case TransparentType.LayereredWindows:
                    EnableTransparentBySetLayered();
                    break;
                }
            }
            else
            {
                // 現在の指定ではなく、透過にした時点の指定に基づいて無効化
                switch (currentTransparentType)
                {
                case TransparentType.DWM:
                    DisableTransparentByDWM();
                    break;

                case TransparentType.LayereredWindows:
                    DisableTransparentBySetLayered();
                    break;
                }

                // 枠ありウィンドウにする
                EnableBorderless(false);

                // 操作の透過をやめる
                EnableClickThrough(false);
            }

            currentTransparentType = TransparentMethod;

            // サイズ変更イベントを発生させる
            SetSize(GetSize());

            // ウィンドウ再描画
            WinApi.ShowWindow(hWnd, WinApi.SW_SHOW);
        }
 /// <summary>
 /// 透過方法を変更
 /// </summary>
 /// <param name="type"></param>
 public void SetTransparentType(TransparentType type)
 {
     if (uniWinCore != null)
     {
         // 透過中だったなら、一度解除して再透過
         if (_isTransparent)
         {
             SetTransparent(false);
             uniWinCore.SetTransparentType((UniWinCore.TransparentType)type);
             transparentType = type;
             SetTransparent(true);
         }
         else
         {
             uniWinCore.SetTransparentType((UniWinCore.TransparentType)type);
             transparentType = type;
         }
     }
 }
예제 #3
0
 /// <summary>
 /// 透過方法を指定(Windowsのみ対応)
 /// </summary>
 /// <param name="type"></param>
 public void SetTransparentType(TransparentType type)
 {
     LibUniWinC.SetTransparentType((Int32)type);
     transparentType = type;
 }