/// <summary> /// 创建窗体 /// </summary> public MainForm() { InitializeComponent(); //创建XML解析器 m_designer = new Designer(); //链接控件库 m_designer.createNative(); m_designer.Script = new DesignerScript(m_designer); m_native = m_designer.Native; 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 FCSize(ClientSize.Width, ClientSize.Height); m_designer.resetScaleSize(getClientSize()); m_native.invalidate(); //加载Xml m_host.LoadingDesigner = true; m_designer.load(Path.Combine(DataCenter.GetAppPath(), "config\\MainFrame.html")); m_host.LoadingDesigner = false; }
/// <summary> /// 添加镜像 /// </summary> /// <param name="native">库</param> /// <param name="target">目标</param> public void addMirror(FCNative native, FCView target) { if (m_native == null) { m_native = new FCNative(); m_native.MirrorMode = FCMirrorMode.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 FCSize(ClientSize.Width, ClientSize.Height); resetScaleSize(getClientSize()); } m_native.addMirror(native, target); m_native.invalidate(); }