Browse Source

zhao:1修改文字,2修改摄像头

ZhangXueYang
耀 3 years ago
parent
commit
2c89a4d08b

BIN
Common/dlls/RbtBezier.dll View File


BIN
Common/dlls/RobotDotMatrix.dll View File


BIN
Common/dlls/RobotUsbWrapper.dll View File


BIN
Common/dlls/RobotpenGateway.dll View File


+ 2
- 2
XHZB.Desktop/App.config View File

@@ -9,8 +9,8 @@
9 9
     <!--是否输出信息日志0否-->
10 10
     <add key="OutputVideoLog" value="0" />
11 11
     <!--版本号-->
12
-    <add key="VersionCode" value="2" />
13
-    <add key="VersionName" value="1.0.2" />
12
+    <add key="VersionCode" value="3" />
13
+    <add key="VersionName" value="1.0.3" />
14 14
     <!--图片压缩质量 0最差 100最佳-->
15 15
     <add key="ImageCompressionLevel" value="100" />
16 16
     <add key="userName" value="" />

+ 3
- 4
XHZB.Desktop/CameraWindow.xaml View File

@@ -5,12 +5,11 @@
5 5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6 6
         xmlns:local="clr-namespace:XHZB.Desktop" xmlns:wfi="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
7 7
 xmlns:aforge ="clr-namespace:AForge.Controls;assembly=AForge.Controls"
8
-        mc:Ignorable="d"
9
-        Title="摄像头" Height="200" Width="250" ResizeMode="NoResize"
8
+        mc:Ignorable="d" Height="180" Width="320" ResizeMode="NoResize" WindowStyle="None" 
10 9
     >
11 10
     <Grid>
12
-        <wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Margin="0">
13
-            <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
11
+        <wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Margin="0" Cursor="SizeAll" >
12
+            <aforge:VideoSourcePlayer x:Name="player" Height="180" Width="320" MouseDown="player_MouseDown" MouseMove="player_MouseMove"/>
14 13
         </wfi:WindowsFormsHost>
15 14
     </Grid>
16 15
 </Window>

+ 91
- 0
XHZB.Desktop/CameraWindow.xaml.cs View File

@@ -32,5 +32,96 @@ namespace XHZB.Desktop
32 32
                 player.Start();
33 33
             }
34 34
         }
35
+
36
+        #region 窗体移动
37
+        /// <summary>
38
+        /// 记录初始点
39
+        /// </summary>
40
+        Point mPoint = new Point(0,0);
41
+        bool IsStretching = false;
42
+        int Position = 0;
43
+        private void player_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
44
+        {
45
+            mPoint = new Point(e.X, e.Y);
46
+        }
47
+
48
+        private void player_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
49
+        {
50
+            if (e.Button == System.Windows.Forms.MouseButtons.Left)
51
+            {
52
+                if (IsStretching)
53
+                {
54
+                    switch (Position)
55
+                    {
56
+                        case 1:
57
+                            this.Left = this.Left - (mPoint.X - e.X);
58
+                            this.Top = this.Top - (mPoint.Y - e.Y);
59
+                            this.Width = this.Width + (mPoint.X - e.X);
60
+                            this.Height = this.Height + (mPoint.Y - e.Y);
61
+                            break;
62
+                        case 2:
63
+                            this.Left = this.Left - (mPoint.X - e.X);
64
+                            this.Width = this.Width + (mPoint.X - e.X);
65
+                            this.Height = this.Height - (mPoint.Y - e.Y);
66
+                            mPoint = new Point(mPoint.X, e.Y);
67
+                            break;
68
+                        case 3:
69
+                            this.Top = this.Top - (mPoint.Y - e.Y);
70
+                            this.Width = this.Width - (mPoint.X - e.X);
71
+                            this.Height = this.Height + (mPoint.Y - e.Y);
72
+                            mPoint = new Point(e.X, mPoint.Y);
73
+                            break;
74
+                        case 4:
75
+                            this.Width = this.Width - (mPoint.X - e.X);
76
+                            this.Height = this.Height - (mPoint.Y - e.Y);
77
+                            mPoint = new Point(e.X, e.Y);
78
+                            break;
79
+                        default:
80
+                            break;
81
+                    }
82
+                }
83
+                else
84
+                {
85
+                    this.Left = this.Left - (mPoint.X - e.X);
86
+                    this.Top = this.Top - (mPoint.Y - e.Y);
87
+                }
88
+            }
89
+            if (e.Button == System.Windows.Forms.MouseButtons.None)
90
+            {
91
+                if (e.X <= 5 && e.Y <= 5)//左上
92
+                {
93
+                    IsStretching = true;
94
+                    Position = 1;
95
+                    wfhCamera.Cursor = Cursors.SizeNWSE;
96
+                }
97
+                else if (e.X <= 5 && e.Y >= wfhCamera.ActualHeight - 5)//左下
98
+                {
99
+                    IsStretching = true;
100
+                    Position = 2;
101
+                    wfhCamera.Cursor = Cursors.SizeNESW;
102
+                }
103
+                else if (e.X >= wfhCamera.ActualWidth - 5 && e.Y <= 5)//右上
104
+                {
105
+                    IsStretching = true;
106
+                    Position = 3;
107
+                    wfhCamera.Cursor = Cursors.SizeNESW;
108
+                }
109
+                else if (e.X >= wfhCamera.ActualWidth - 5 && e.Y >= wfhCamera.ActualHeight - 5)//右下
110
+                {
111
+                    IsStretching = true;
112
+                    Position = 4;
113
+                    wfhCamera.Cursor = Cursors.SizeNWSE;
114
+                }
115
+                else
116
+                {
117
+                    IsStretching = false;
118
+                    wfhCamera.Cursor = Cursors.SizeAll;
119
+                }
120
+
121
+            }
122
+
123
+        }
124
+        #endregion
125
+
35 126
     }
36 127
 }

+ 1
- 0
XHZB.Desktop/LoginWindow.xaml View File

@@ -466,6 +466,7 @@
466 466
                 VerticalAlignment="Bottom"/>
467 467
                 </StackPanel>
468 468
             </Button>
469
+            <!--<Button Content="Button" HorizontalAlignment="Left" Margin="380,79,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>-->
469 470
         </Grid>
470 471
     </Viewbox>
471 472
 </Window>

+ 15
- 0
XHZB.Desktop/LoginWindow.xaml.cs View File

@@ -990,6 +990,21 @@ namespace XHZB.Desktop
990 990
         {
991 991
             MessageWindow.Show(msg);
992 992
         }
993
+
994
+        private void Button_Click(object sender, RoutedEventArgs e)
995
+        {
996
+
997
+
998
+        double pwidth = SystemParameters.PrimaryScreenWidth;
999
+            if (APP.W_CameraWindow == null)
1000
+            {
1001
+                APP.W_CameraWindow = new CameraWindow();
1002
+                APP.W_CameraWindow.Topmost = true;
1003
+                APP.W_CameraWindow.Left = pwidth - 320;
1004
+                APP.W_CameraWindow.Top = 0;
1005
+            }
1006
+            APP.W_CameraWindow.Show();
1007
+        }
993 1008
     }
994 1009
 
995 1010
     public class LoginPageData : NotifyModel

+ 2
- 2
XHZB.Desktop/Properties/AssemblyInfo.cs View File

@@ -51,5 +51,5 @@ using System.Windows;
51 51
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
52 52
 //通过使用 "*",如下所示:
53 53
 // [assembly: AssemblyVersion("1.0.*")]
54
-[assembly: AssemblyVersion("1.0.2.0")]
55
-[assembly: AssemblyFileVersion("1.0.2.0")]
54
+[assembly: AssemblyVersion("1.0.3.0")]
55
+[assembly: AssemblyFileVersion("1.0.3.0")]

+ 25
- 22
XHZB.Desktop/ToolbarWindow.xaml.cs View File

@@ -80,7 +80,7 @@ namespace XHZB.Desktop
80 80
             });
81 81
             pageData.menuList.Add(new ToolbarMenu()
82 82
             {
83
-                Name = "直播",
83
+                Name = "开始直播",
84 84
                 Pic = "../Images/ToolBar/直播@2x.png"
85 85
             });
86 86
             pageData.menuList.Add(new ToolbarMenu()
@@ -100,7 +100,7 @@ namespace XHZB.Desktop
100 100
             });
101 101
             pageData.menuList.Add(new ToolbarMenu()
102 102
             {
103
-                Name = "结束课堂",
103
+                Name = "结束直播",
104 104
                 Pic = "../Images/ToolBar/下课@2x.png"
105 105
             });
106 106
 
@@ -173,29 +173,32 @@ namespace XHZB.Desktop
173 173
             }
174 174
             else if (clickindex == 1)//直播
175 175
             {
176
-                HideLevel2();
177
-                pageData.tongping = !pageData.tongping;
178
-                if (pageData.tongping&& isTool)
176
+                if (!pageData.tongping)
179 177
                 {
180
-                    isTool = false;
181
-                    if (StartLive(out string ErrMessage))
178
+                    HideLevel2();
179
+                    pageData.tongping = !pageData.tongping;
180
+                    if (pageData.tongping && isTool)
182 181
                     {
183
-                        pageData.menuList[1].Pic = "../Images/ToolBar/img_shared_1.gif";
184
-                        pageData.menuList[1].Name = "正在直播";
185
-
186
-                        if (APP.W_CameraWindow == null)
182
+                        isTool = false;
183
+                        if (StartLive(out string ErrMessage))
187 184
                         {
188
-                            APP.W_CameraWindow = new CameraWindow();
189
-                            APP.W_CameraWindow.Topmost = true;
190
-                            APP.W_CameraWindow.Left = pwidth - 300;
191
-                            APP.W_CameraWindow.Top = 0;
185
+                            pageData.menuList[1].Pic = "../Images/ToolBar/img_shared_1.gif";
186
+                            pageData.menuList[1].Name = "正在直播";
187
+
188
+                            if (APP.W_CameraWindow == null)
189
+                            {
190
+                                APP.W_CameraWindow = new CameraWindow();
191
+                                APP.W_CameraWindow.Topmost = true;
192
+                                APP.W_CameraWindow.Left = pwidth - 320;
193
+                                APP.W_CameraWindow.Top = 0;
194
+                            }
195
+                            APP.W_CameraWindow.Show();
196
+                        }
197
+                        else
198
+                        {
199
+                            pageData.tongping = !pageData.tongping;
200
+                            MessageWindow.Show(ErrMessage);
192 201
                         }
193
-                        APP.W_CameraWindow.Show();
194
-                    }
195
-                    else
196
-                    {
197
-                        pageData.tongping = !pageData.tongping;
198
-                        MessageWindow.Show(ErrMessage);
199 202
                     }
200 203
                 }
201 204
             }
@@ -269,7 +272,7 @@ namespace XHZB.Desktop
269 272
             }
270 273
             else if (clickindex == 5)//结束课堂。
271 274
             {
272
-                if (MessageWindow.Show("是否结束课堂?", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
275
+                if (MessageWindow.Show("是否结束直播?", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
273 276
                 {
274 277
                     closeAction();
275 278
                 }

Loading…
Cancel
Save