public static ProjectionConfig LoadDefaults()
 {
     ProjectionConfig projection = new ProjectionConfig();
     projection.OffsetX = DEFAULT_OFFSETX;
     projection.OffsetY = DEFAULT_OFFSETY;
     projection.ScaleX = DEFAULT_SCALEX;
     projection.ScaleY = DEFAULT_SCALEY;
     return projection;
 }
Beispiel #2
0
        public static ProjectionConfig LoadDefaults()
        {
            ProjectionConfig projection = new ProjectionConfig();

            projection.OffsetX = DEFAULT_OFFSETX;
            projection.OffsetY = DEFAULT_OFFSETY;
            projection.ScaleX  = DEFAULT_SCALEX;
            projection.ScaleY  = DEFAULT_SCALEY;
            return(projection);
        }
Beispiel #3
0
        public Window1()
        {
            InitializeComponent();

            double resolutionX = SystemParameters.PrimaryScreenWidth;
            double resolutionY = SystemParameters.PrimaryScreenHeight;

            string           path   = @"Config\UserSettings.xml";
            ProjectionConfig config = ProjectionConfig.Load(path);

            switchFullScreen(config, resolutionX, resolutionY);
        }
Beispiel #4
0
        void switchFullScreen(ProjectionConfig proj, double resolutionX, double resolutionY)
        {
            SurfaceArea = GetScreenDimensions(proj.OffsetX,
                                              proj.OffsetY,
                                              proj.ScaleX,
                                              proj.ScaleY,
                                              resolutionX,
                                              resolutionY);

            this.Width  = SurfaceArea.Width;
            this.Height = SurfaceArea.Height;
            this.Top    = SurfaceArea.Top;
            this.Left   = SurfaceArea.Left;

            this.ResizeMode  = ResizeMode.NoResize;
            this.WindowStyle = WindowStyle.None;
            this.Topmost     = true;
        }
        void switchFullScreen(ProjectionConfig proj, double resolutionX, double resolutionY)
        {
            SurfaceArea = GetScreenDimensions(proj.OffsetX,
                proj.OffsetY,
                proj.ScaleX,
                proj.ScaleY,
                resolutionX,
                resolutionY);

            this.Width = SurfaceArea.Width;
            this.Height = SurfaceArea.Height;
            this.Top = SurfaceArea.Top;
            this.Left = SurfaceArea.Left;

            this.ResizeMode = ResizeMode.NoResize;
            this.WindowStyle = WindowStyle.None;
            this.Topmost = true;
        }
        public static ProjectionConfig Load(string userSettingsPath)
        {
            if (!File.Exists(userSettingsPath)) return null;

            XPathDocument doc = new XPathDocument(userSettingsPath);
            XPathNavigator nav = doc.CreateNavigator();

            XPathNavigator posxA = nav.SelectSingleNode("//Projection/Screens/Screen/@PosX");
            XPathNavigator posyA = nav.SelectSingleNode("//Projection/Screens/Screen/@PosY");
            XPathNavigator scalexA = nav.SelectSingleNode("//Projection/Screens/Screen/@ScaleX");
            XPathNavigator scaleyA = nav.SelectSingleNode("//Projection/Screens/Screen/@ScaleY");

            ProjectionConfig projection = new ProjectionConfig();
            projection.OffsetX = float.Parse(posxA.Value);
            projection.OffsetY = float.Parse(posyA.Value) * -1;
            projection.ScaleX = float.Parse(scalexA.Value);
            projection.ScaleY = float.Parse(scaleyA.Value);
            return projection;
        }
Beispiel #7
0
        public static ProjectionConfig Load(string userSettingsPath)
        {
            if (!File.Exists(userSettingsPath))
            {
                return(null);
            }

            XPathDocument  doc = new XPathDocument(userSettingsPath);
            XPathNavigator nav = doc.CreateNavigator();

            XPathNavigator posxA   = nav.SelectSingleNode("//Projection/Screens/Screen/@PosX");
            XPathNavigator posyA   = nav.SelectSingleNode("//Projection/Screens/Screen/@PosY");
            XPathNavigator scalexA = nav.SelectSingleNode("//Projection/Screens/Screen/@ScaleX");
            XPathNavigator scaleyA = nav.SelectSingleNode("//Projection/Screens/Screen/@ScaleY");

            ProjectionConfig projection = new ProjectionConfig();

            projection.OffsetX = float.Parse(posxA.Value);
            projection.OffsetY = float.Parse(posyA.Value) * -1;
            projection.ScaleX  = float.Parse(scalexA.Value);
            projection.ScaleY  = float.Parse(scaleyA.Value);
            return(projection);
        }