From f16fd06aa226e9f97a27858624d4ea7cf8975d25 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 07 五月 2024 17:24:38 +0800 Subject: [PATCH] 增加了萤石摄像头 --- HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 47 insertions(+), 3 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs index f92dd5d..f069cc9 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs @@ -1,4 +1,5 @@ 锘縰sing System; +using System.IO; using System.Threading; using HDL_ON.DAL.Server; using HDL_ON.Entity; @@ -66,14 +67,17 @@ public void LoadPage() { - new TopViewDiv(bodyView, Language.StringByID(StringId.FacePassage)).LoadTopView(); + var topNavView = new TopViewDiv(bodyView, Language.StringByID(StringId.FacePassage)); + topNavView.maginY = 10; + topNavView.LoadTopView(); + bodyView.BackgroundColor = CSS_Color.BackgroundColor; contentView = new FrameLayout() { - Y = Application.GetRealHeight(64), - Height = Application.GetRealHeight(667 - 64), + Y = Application.GetRealHeight(64+10), + Height = Application.GetRealHeight(667 - 64 - 10), }; bodyView.AddChidren(contentView); @@ -168,6 +172,12 @@ TextID = StringId.AboutFaceIdAndPrivacy }; contentView.AddChidren(btnTip); + btnTip.MouseUpEventHandler += (sender2, e2) => + { + string url = "https://developer.hdlcontrol.com/FaceProtocolSantam.html"; + new WebViewDialog().LoadPage(Language.StringByID(StringId.GetFaceProtocol), url); + + }; btnSetFaceId = new Button() @@ -531,6 +541,39 @@ { //1.璇诲彇瑁佸壀鍚庣殑鍥剧墖锛岀劧鍚庡垹闄� var imageBytes = Shared.IO.FileUtils.ReadFile(selectImagePath); + + + System.IO.FileStream fs = null; + try + { + if (System.IO.File.Exists(System.IO.Path.Combine(Application.RootPath, selectImagePath))) + { + fs = new FileStream(System.IO.Path.Combine(Application.RootPath, selectImagePath), FileMode.Open, FileAccess.Read); + } + else if (System.IO.File.Exists(selectImagePath)) + { + fs = new FileStream(selectImagePath, FileMode.Open, FileAccess.Read); + } + else + { + } + byte[] bytes = new byte[fs.Length]; + fs.Read(bytes, 0, bytes.Length); + } + catch(Exception ex) + { + Console.WriteLine(ex.Message); + } + finally + { + if (fs != null) + { + fs.Close(); + } + + } + + System.IO.File.Delete(selectImagePath); var waitPage = new Loading(); @@ -542,6 +585,7 @@ try { string base64string = Convert.ToBase64String(imageBytes); + Console.WriteLine("wxr" + base64string); //Utlis.WriteLine("涓婁紶鍥剧墖Length:" + imageBytes.Length + " base64锛�" + base64string); var pack = new HttpServerRequest().FaceSetting(base64string); if (pack != null) -- Gitblit v1.8.0