Browse Source

新增横屏与竖屏配置

master
胡超1 12 months ago
parent
commit
81dad4f043
  1. 11
      CPF_Cef/AksVideoPlayer.cs
  2. 30
      CPF_Cef/FrmMain.cs
  3. 2
      CPF_Cef/Parame.cs

11
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;

30
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<TextBox>(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";

2
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

Loading…
Cancel
Save