Beispiel #1
0
 /// <summary>
 /// 添加镜像
 /// </summary>
 /// <param name="native">库</param>
 /// <param name="target">目标</param>
 public void AddMirror(INativeBase native, ControlA target)
 {
     if (target.Parent == null || (target.Location.x == 0 && target.Location.y == 0))
     {
         ClientSize = new Size(target.Size.cx, target.Size.cy);
     }
     else
     {
         ClientSize = new Size(target.Parent.Size.cx, target.Parent.Size.cy);
     }
     if (m_native == null)
     {
         m_native              = NativeHandler.CreateNative();
         m_native.MirrorMode   = MirrorMode.Shadow;
         m_native.Paint        = new GdiPlusPaintEx();
         m_native.Host         = new WinHostEx();
         m_native.Host.Native  = m_native;
         m_native.ResourcePath = WinHostEx.GetAppPath() + "\\config";
         m_host      = m_native.Host as WinHostEx;
         m_host.HWnd = Handle;
         //设置尺寸
         m_native.AllowScaleSize = true;
         m_native.DisplaySize    = new SIZE(ClientSize.Width, ClientSize.Height);
         ResetScaleSize(GetClientSize());
     }
     m_native.AddMirror(native, target);
     m_native.Invalidate();
 }
Beispiel #2
0
 /// <summary>
 /// 添加镜像
 /// </summary>
 /// <param name="native">库</param>
 /// <param name="target">目标</param>
 public void AddBugHole(INativeBase native, ControlA target)
 {
     if (m_native == null)
     {
         m_native              = NativeHandler.CreateNative();
         m_native.MirrorMode   = MirrorMode.BugHole;
         m_native.Paint        = new GdiPlusPaintEx();
         m_native.Host         = new WinHostEx();
         m_native.Host.Native  = m_native;
         m_native.ResourcePath = WinHostEx.GetAppPath() + "\\config";
         m_host      = m_native.Host as WinHostEx;
         m_host.HWnd = Handle;
         //设置尺寸
         m_native.AllowScaleSize = true;
         m_native.DisplaySize    = new SIZE(ClientSize.Width, ClientSize.Height);
         ResetScaleSize(GetClientSize());
     }
     m_native.AddMirror(native, target);
     m_native.Update();
     m_native.Invalidate();
 }