From 81dad4f0437e5b0704eff72b1b6dd1e0ed41de79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=BD=87=E9=98=B3?= Date: Tue, 6 Aug 2024 15:36:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A8=AA=E5=B1=8F=E4=B8=8E?= =?UTF-8?q?=E7=AB=96=E5=B1=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CPF_Cef/AksVideoPlayer.cs | 11 +++++++++-- CPF_Cef/FrmMain.cs | 30 ++++++++++++++++++++++-------- CPF_Cef/Parame.cs | 2 ++ 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/CPF_Cef/AksVideoPlayer.cs b/CPF_Cef/AksVideoPlayer.cs index 1914d28..f5d71c3 100644 --- a/CPF_Cef/AksVideoPlayer.cs +++ b/CPF_Cef/AksVideoPlayer.cs @@ -49,8 +49,15 @@ namespace AksWebBrowser { IsAntiAlias = true; CornerRadius = "3,3,3,3"; - Height = "1920"; - Width = "1080"; + if (Parame.sfhp) + { + Height = "1080"; + Width = "1920"; + } + else { + Height = "1920"; + Width = "1080"; + } Background = "#2c2c2c"; ZIndex = 100; //WindowState = WindowState = WindowState.FullScreen; diff --git a/CPF_Cef/FrmMain.cs b/CPF_Cef/FrmMain.cs index c82b683..c9ae442 100644 --- a/CPF_Cef/FrmMain.cs +++ b/CPF_Cef/FrmMain.cs @@ -21,10 +21,8 @@ namespace AksWebBrowser { public class FrmMain : Window { - public int w = 1080; - public int h = 1920; - //public int h = 1080; - //public int w = 1920; + public int h = 1080; + public int w = 1920; protected override void InitializeComponent() { @@ -69,8 +67,16 @@ namespace AksWebBrowser { LoadStyleFile("res://AksWebBrowser/StyleSheet.css"); //窗体大小 - this.Width = w; - this.Height = h; + if (Parame.sfhp) + { + this.Height = h; + this.Width = w; + } + else + { + this.Height = w; + this.Width = h; + } //SetTaskStatus.Hidetask(); base.OnInitialized(); //初始化网络连接(硬件服务响应) @@ -79,8 +85,16 @@ namespace AksWebBrowser textBox = FindPresenterByName(nameof(textBox)); Parame.webBrowser.CusRequest.CusResquestEvent += CusRequest_CusResquestEvent; //浏览器大小 - Parame.webBrowser.Width = w; - Parame.webBrowser.Height = h; + if (Parame.sfhp) + { + Parame.webBrowser.Width = w; + Parame.webBrowser.Height = h; + } + else + { + Parame.webBrowser.Width = h; + Parame.webBrowser.Height = w; + } //Parame.webBrowser.Url = "http://143.169.62.3:8096/#/main-out";//天府新区 Parame.webBrowser.Url = "http://127.0.0.1:8096/#/main-out"; //Parame.webBrowser.Url = "http://192.168.0.34:8078/#/main-out"; diff --git a/CPF_Cef/Parame.cs b/CPF_Cef/Parame.cs index bd57d4d..e3fabf1 100644 --- a/CPF_Cef/Parame.cs +++ b/CPF_Cef/Parame.cs @@ -25,6 +25,8 @@ namespace AksWebBrowser public static string apiUrl ="http://127.0.0.1:8098";//"http://143.169.62.3:8098";// //授权key public static string key = "1"; + //是否横屏 + public static bool sfhp = true; //硬件Ip public static string Ip = "192.168.1.166"; //高拍仪url