using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FaceSdkX64Register
{
public class OpaqueCommand
{
private MyOpaqueLayer m_OpaqueLayer = null;//半透明蒙板层
///
/// 显示遮罩层
///
/// 控件
/// 透明度
/// 是否显示图标
public void ShowOpaqueLayer(Control control, int alpha, bool isShowLoadingImage = true)
{
try
{
if (m_OpaqueLayer == null)
{
this.m_OpaqueLayer = new MyOpaqueLayer(alpha, isShowLoadingImage);
control.Controls.Add(this.m_OpaqueLayer);
this.m_OpaqueLayer.Dock = DockStyle.Fill;
this.m_OpaqueLayer.BringToFront();
}
this.m_OpaqueLayer.Enabled = true;
this.m_OpaqueLayer.Visible = true;
}
catch(Exception ex) { }
}
///
/// 隐藏遮罩层
///
public void HideOpaqueLayer()
{
try
{
if (this.m_OpaqueLayer != null)
{
this.m_OpaqueLayer.Visible = false;
this.m_OpaqueLayer.Enabled = false;
}
}
catch (Exception ex)
{
//MessageBox.Show(ex.Message);
}
}
}
}