Exemplo n.º 1
0
    /// <summary>
    /// 获取当前数据
    /// </summary>
    /// <param name="refreshF3Device">是否刷新显示设备信息</param>
    public void DoProcess(bool refreshF3Device = false)
    {
        //窗口范围
        GlobalData data = Global.Instance.Data;

        MainWindowRect       = WindowHelper.GetWindownRect(data.MainWindowHandle);
        ProjectionWindowRect = WindowHelper.GetWindownRect(data.ProjectionWindowHandle);

        //刷新显示设备列表
        if (refreshF3Device)
        {
            F3Device.DeviceManager.Instance.Refresh();
        }

        //显示器范围
        F3Device.Screen.Monitor        monitor;
        List <F3Device.Screen.Monitor> monitorList = null;

        monitorList = F3Device.DeviceManager.Instance.FindMonitors((int)MainWindowRect.xMin, (int)MainWindowRect.yMin, (int)MainWindowRect.xMax, (int)MainWindowRect.yMax);
        if (monitorList.Count != 0)
        {
            monitor = monitorList[0];
            F3Device.Screen.RECT rect = monitor.m_MonitorInfo.rcMonitor;
            MainMonitorRect = new Rect(rect.Left, rect.Top, rect.Width, rect.Height);
            MainDevice      = F3Device.DeviceManager.Instance.FindDevice(rect.Left, rect.Top, rect.Right, rect.Bottom);
        }
        else
        {
            MainMonitorRect = new Rect();
            MainDevice      = null;
        }
        monitorList = F3Device.DeviceManager.Instance.FindMonitors((int)ProjectionWindowRect.xMin, (int)ProjectionWindowRect.yMin, (int)ProjectionWindowRect.xMax, (int)ProjectionWindowRect.yMax);
        if (monitorList.Count != 0)
        {
            monitor = monitorList[0];
            F3Device.Screen.RECT rect = monitor.m_MonitorInfo.rcMonitor;
            ProjectionMonitorRect = new Rect(rect.Left, rect.Top, rect.Width, rect.Height);
            ProjectionDevice      = F3Device.DeviceManager.Instance.FindDevice(rect.Left, rect.Top, rect.Right, rect.Bottom);
        }
        else
        {
            ProjectionMonitorRect = new Rect();
            ProjectionDevice      = null;
        }

        DoProcessDevice();
    }
Exemplo n.º 2
0
    /// <summary>
    /// 控制设备切换2/3D
    /// </summary>
    /// <param name="dev">设备</param>
    /// <param name="is3D">是否为3D</param>
    public void SwitchScreenState(F3Device.Device.BaseDevice dev, bool is3D)
    {
        if (dev == null)
        {
            return;
        }

        if (dev is IFrame3Device)
        {
            IFrame3Device iDevice = dev as IFrame3Device;
            if (is3D)
            {
                iDevice.Switch_IFrame_3D();
            }
            else
            {
                iDevice.Switch_IFrame_2D();
            }
        }
        else if (dev is IGraph3Device)
        {
            IGraph3Device iDevice = dev as IGraph3Device;
            if (is3D)
            {
                iDevice.Switch_IGraph_LR_3D();
            }
            else
            {
                iDevice.Switch_IGraph_2D();
            }
        }

        if (dev == MainDevice)
        {
            m_mainDeviceIs3D = is3D;
        }
        if (dev == ProjectionDevice)
        {
            m_proDeviceIs3D = is3D;
        }
    }