Explorar el Código

zhao:解决冲突

tags/录制修改前
耀 hace 4 años
padre
commit
78dc5b8e9c

+ 17
- 9
Common/system/ImageHelper.cs Ver fichero

@@ -3,6 +3,7 @@ using System.Configuration;
3 3
 using System.Drawing;
4 4
 using System.Drawing.Imaging;
5 5
 using System.IO;
6
+using System.Security.Policy;
6 7
 using System.Text;
7 8
 using System.Threading;
8 9
 using System.Windows;
@@ -111,10 +112,13 @@ namespace Common.system
111 112
         /// </summary>
112 113
         /// <param name="ScreenSize">截图的区域,设置new Rectangle(0, 0, 0, 0)为截全屏</param>
113 114
         /// <param name="ImageSavePath">图片存储路径,为空或null则保存到临时文件夹</param>
115
+        /// <param name="IsRetImg">是否返回图片</param>
116
+        /// <param name="bitmapimg">图片</param>
114 117
         /// <param name="level">压缩等级,0到100,0 最差质量,100 最佳</param>
115 118
         /// <returns></returns>
116
-        public static BitmapImage GetScreenshot(Rectangle ScreenSize, string ImageSavePath, long level = -1)
119
+        public static bool GetScreenshot(Rectangle ScreenSize, string ImageSavePath, bool IsRetImg, out BitmapImage bitmapimg, long level = -1)
117 120
         {
121
+            bitmapimg = null;
118 122
             try
119 123
             {
120 124
                 System.Drawing.Size bounds = PrimaryScreen.DESKTOP;
@@ -143,15 +147,19 @@ namespace Common.system
143 147
                     g.CopyFromScreen(l, t, 0, 0, _Bitmap.Size, CopyPixelOperation.SourceCopy);
144 148
                     Compress(_Bitmap, ImageSavePath, level);
145 149
                 }
146
-                Uri uri = new Uri(ImageSavePath, UriKind.Absolute);
147
-                BitmapImage bimg = new BitmapImage(uri);
150
+                if (IsRetImg)
151
+                {
152
+
153
+                    Uri uri = new Uri(ImageSavePath, UriKind.Absolute);
154
+                    bitmapimg = new BitmapImage(uri);
155
+                }
148 156
                 GC.Collect();
149
-                return bimg;
157
+                return true;
150 158
             }
151 159
             catch (Exception ex)
152 160
             {
153 161
                 LogHelper.WriteErrLog("【截图】(GetBitmapSource)截图失败," + ex.Message, ex);
154
-                return null;
162
+                return false;
155 163
             }
156 164
         }
157 165
         /// <summary>
@@ -161,8 +169,8 @@ namespace Common.system
161 169
         public static string GetTempImagePath()
162 170
         {
163 171
             TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
164
-            
165
-            string TempPath=FileToolsCommon.GetFileAbsolutePath("/temp/Screenshot/");
172
+
173
+            string TempPath = FileToolsCommon.GetFileAbsolutePath("/temp/Screenshot/");
166 174
             FileToolsCommon.CreateDirectory(TempPath);
167 175
             TempPath += Convert.ToInt64(ts.TotalMilliseconds).ToString() + ".jpg";
168 176
             return TempPath;
@@ -468,7 +476,7 @@ namespace Common.system
468 476
                     break;
469 477
             }
470 478
 
471
-            if(right - left<=0)//zxyceshi
479
+            if (right - left <= 0)//zxyceshi
472 480
             {
473 481
                 //克隆位图对象的一部分。
474 482
                 System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, 1, bottom - top);
@@ -486,7 +494,7 @@ namespace Common.system
486 494
                 //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
487 495
                 return cloneBitmap;
488 496
             }
489
-         
497
+
490 498
         }
491 499
 
492 500
         /// <summary>

+ 2
- 0
XHWK.WKTool/App.cs Ver fichero

@@ -131,12 +131,14 @@ namespace XHWK.WKTool
131 131
         /// 提示窗口
132 132
         /// </summary>
133 133
         public static PromptWindow W_PromptWindow = null;
134
+        public static LoadDialog myloading;
134 135
         #endregion
135 136
         #endregion
136 137
 
137 138
         [STAThread]
138 139
         private static void Main()
139 140
         {
141
+            myloading = new LoadDialog();
140 142
             StopSameProcess();
141 143
             Killffmpeg();
142 144
             LatticeFileHelper.RunPrintConfig();

+ 105
- 80
XHWK.WKTool/FileDirectoryWindow.xaml Ver fichero

@@ -7,7 +7,7 @@
7 7
         mc:Ignorable="d"
8 8
         Title="FileDirectoryWindow" Height="729" Width="1030" AllowsTransparency="True" 
9 9
     ShowInTaskbar="False" MouseLeftButtonDown="Window_MouseLeftButtonDown_1" MouseLeftButtonUp="Window_MouseLeftButtonUp"
10
-    WindowStartupLocation="CenterOwner"
10
+    WindowStartupLocation="CenterOwner" 
11 11
     WindowStyle="None">
12 12
     <Window.Resources>
13 13
         <!--  ListBox容器样式  -->
@@ -31,16 +31,16 @@
31 31
         </Style>
32 32
         <DataTemplate x:Key="TongjiItem">
33 33
             <UniformGrid
34
-                Height="36"
34
+                Height="50"
35 35
                 Margin="0,0,0,0"
36 36
                 Background="{Binding Colour}"
37
-                Columns="6"
37
+                Columns="5"
38 38
                 Rows="1">
39 39
                 <!--题号-->
40 40
                 <TextBlock 
41 41
                     HorizontalAlignment="Center"
42 42
                     VerticalAlignment="Center"
43
-                    FontSize="15"
43
+                    FontSize="16"
44 44
                     Text="{Binding SerialNumber}" />
45 45
                 <Grid>
46 46
                     <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
@@ -48,38 +48,38 @@
48 48
                         <TextBox IsEnabled="{Binding IsEnabled}"
49 49
                     HorizontalAlignment="Center"
50 50
                     VerticalAlignment="Center"
51
-                    FontSize="15"
52
-                    Text="{Binding VideoName,Mode=TwoWay}" />
51
+                    FontSize="16" Height="30" Padding="0,5,0,0"
52
+                    Text="{Binding VideoName,Mode=TwoWay}" Width="150"/>
53 53
                         <Button x:Name="btnModify" Background="Transparent"
54 54
                                 Cursor="Hand"
55 55
                         BorderThickness="0" Click="BtnModify_Click">
56 56
                             <Grid>
57
-                                <Image Source="./Images/fileDirectory3.png" Margin="6,6,6,6" Visibility="{Binding vis}"/>
58
-                                <Image Source="./Images/fileDirectory4.png" Margin="6,6,6,6" Visibility="{Binding cos}"/>
57
+                                <Image Source="./Images/fileDirectory3.png" Margin="6,6,6,6" Height="20" Visibility="{Binding vis}"/>
58
+                                <Image Source="./Images/fileDirectory4.png" Margin="6,6,6,6" Height="20" Visibility="{Binding cos}"/>
59 59
                             </Grid>
60 60
                         </Button>
61 61
                     </StackPanel>
62 62
                 </Grid>
63 63
           
64 64
            
65
-                <!--分值-->
65
+                <!--分值--><!--
66 66
                 <TextBlock
67 67
                     HorizontalAlignment="Center"
68 68
                     VerticalAlignment="Center"
69 69
                     FontSize="15"
70
-                    Text="{Binding VideoDuration}" />
70
+                    Text="{Binding VideoDuration}" />-->
71 71
 
72 72
                 <!--平均时长-->
73 73
                 <TextBlock
74 74
                     HorizontalAlignment="Center"
75 75
                     VerticalAlignment="Center"
76
-                    FontSize="15"
76
+                    FontSize="16"
77 77
                     Text="{Binding VideoSize}" />
78 78
                 <!--最短时长-->
79 79
                 <TextBlock
80 80
                     HorizontalAlignment="Center"
81 81
                     VerticalAlignment="Center"
82
-                    FontSize="15"
82
+                    FontSize="16"
83 83
                     Text="{Binding VideoTime}" />
84 84
 
85 85
                 <Grid>
@@ -89,24 +89,24 @@
89 89
                                 Cursor="Hand"
90 90
                         BorderThickness="0" Click="BtnPlay_Click">
91 91
                             <Grid>
92
-                                <Image Source="./Images/fileDirectory1.png" Margin="6,6,6,6" Visibility="{Binding vis}"/>
93
-                                <Image Source="./Images/fileDirectory2.png" Margin="6,6,6,6" Visibility="{Binding cos}"/>
92
+                                <Image Source="./Images/fileDirectory1.png" Margin="10" Height="20" Visibility="{Binding vis}"/>
93
+                                <Image Source="./Images/fileDirectory2.png" Margin="10" Visibility="{Binding cos}"/>
94 94
                             </Grid>
95 95
                         </Button>
96 96
                         <Button x:Name="btnUpload" Background="Transparent"
97 97
                                 Cursor="Hand"
98 98
                         BorderThickness="0" Click="BtnUpload_Click">
99 99
                             <Grid>
100
-                                <Image Source="./Images/fileDirectory7.png" Margin="6,6,6,6" Visibility="{Binding vis}"/>
101
-                                <Image Source="./Images/fileDirectory8.png" Margin="6,6,6,6" Visibility="{Binding cos}"/>
100
+                                <Image Source="./Images/fileDirectory7.png" Margin="6,6,6,6" Height="20" Visibility="{Binding vis}"/>
101
+                                <Image Source="./Images/fileDirectory8.png" Margin="6,6,6,6" Height="20" Visibility="{Binding cos}"/>
102 102
                             </Grid>
103 103
                         </Button>
104 104
                         <Button x:Name="btnDelete" Background="Transparent"
105 105
                                 Cursor="Hand"
106 106
                         BorderThickness="0" Click="BtnDelete_Click">
107 107
                             <Grid>
108
-                                <Image Source="./Images/fileDirectory5.png" Margin="6,6,6,6" Visibility="{Binding vis}"/>
109
-                                <Image Source="./Images/fileDirectory6.png" Margin="6,6,6,6" Visibility="{Binding cos}"/>
108
+                                <Image Source="./Images/fileDirectory5.png" Margin="6,6,6,6" Height="20" Visibility="{Binding vis}"/>
109
+                                <Image Source="./Images/fileDirectory6.png" Margin="6,6,6,6" Height="20" Visibility="{Binding cos}"/>
110 110
                             </Grid>
111 111
                         </Button>
112 112
                     </StackPanel>
@@ -117,64 +117,81 @@
117 117
         </DataTemplate>
118 118
     </Window.Resources>
119 119
     <Viewbox>
120
-        <Grid Height="729" Width="1030" >
121
-            <!--分4行-->
122
-            <Grid.RowDefinitions>
123
-                <RowDefinition Height="45"/>
124
-                <RowDefinition Height="*"/>
125
-                <RowDefinition Height="80"/>
126
-            </Grid.RowDefinitions>
127
-            <!--第一行 标题-->
128
-            <Border Grid.Row="0" Background="#2D8CF0">
129
-                <Grid  MouseLeftButtonDown="Window_MouseLeftButtonDown">
130
-                    <TextBlock Text="文件目录" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
131
-                    <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="btnDown_Click"/>
132
-                </Grid>
133
-            </Border>
134
-           <!--第二行 内容-->
135
-            <Grid Grid.Row="1" Margin="0,15,0,0">
136
-                <Grid.RowDefinitions>
137
-                    <RowDefinition Height="45"/>
138
-                    <RowDefinition Height="*"/>
139
-                </Grid.RowDefinitions>
140
-                <UniformGrid x:Name="uniStatisticsByTitle"
120
+        <Border Background="#fefefe" Height="729" Width="1030">
121
+            <Border Background="#fdfdfd" Height="727" Width="1028">
122
+                <Border Background="#fcfcfc" Height="725" Width="1026">
123
+                    <Border Background="#fafafa" Height="723" Width="1024">
124
+                        <Border Background="#f9f9f9" Height="721" Width="1022">
125
+                            <Border Background="#f6f6f6" Height="719" Width="1020">
126
+                                <Border Background="#f3f3f3" Height="717" Width="1018">
127
+                                    <Border Background="#eeeeee" Height="715" Width="1016">
128
+                                        <Border Background="#e9e9e9" Height="713" Width="1014">
129
+                                            <Border Background="#e2e2e2" Height="711" Width="1012">
130
+                                                <Border Background="#dcdcdc" Height="709" Width="1010">
131
+                                                    <Border Background="#d3d3d3" Height="707" Width="1008">
132
+                                                        <Border Background="#cccccc" Height="705" Width="1006">
133
+                                                            <Border Background="#bfbfbf" Height="703" Width="1004">
134
+                                                                <Border Background="#aeaeae" Height="701" Width="1002">
135
+                                                                    <Border Background="#bababa" Height="699" Width="1000">
136
+                                                                        <Border Background="#e4e4e4" Height="697" Width="998">
137
+                                                                            <Grid Height="695" Width="998" Background="#FFFFFF" Margin="0,-1,0,0">
138
+                                                                                <!--分4行-->
139
+                                                                                <Grid.RowDefinitions>
140
+                                                                                    <RowDefinition Height="45"/>
141
+                                                                                    <RowDefinition Height="*"/>
142
+                                                                                    <RowDefinition Height="30"/>
143
+                                                                                </Grid.RowDefinitions>
144
+                                                                                <!--第一行 标题-->
145
+                                                                                <Border Grid.Row="0" Background="#2D8CF0">
146
+                                                                                    <Grid  MouseLeftButtonDown="Window_MouseLeftButtonDown">
147
+                                                                                        <TextBlock Text="文件目录" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
148
+                                                                                        <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="btnDown_Click"/>
149
+                                                                                    </Grid>
150
+                                                                                </Border>
151
+                                                                                <!--第二行 内容-->
152
+                                                                                <Grid Grid.Row="1" Margin="0,15,0,0">
153
+                                                                                    <Grid.RowDefinitions>
154
+                                                                                        <RowDefinition Height="45"/>
155
+                                                                                        <RowDefinition Height="*"/>
156
+                                                                                    </Grid.RowDefinitions>
157
+                                                                                    <UniformGrid x:Name="uniStatisticsByTitle"
141 158
                 Grid.Row="0"
142 159
                 Margin="10,0,10,0"
143 160
                 Background="#2D8CF0"
144
-                Columns="6"
161
+                Columns="5"
145 162
                 Rows="1">
146
-                    <TextBlock
163
+                                                                                        <TextBlock
147 164
                     HorizontalAlignment="Center"
148 165
                     VerticalAlignment="Center"
149
-                    FontSize="15"
166
+                    FontSize="16"
150 167
                     Text="序号" Foreground="White" />
151
-                    <TextBlock
168
+                                                                                        <TextBlock
152 169
                     HorizontalAlignment="Center"
153 170
                     VerticalAlignment="Center"
154
-                    FontSize="15"
171
+                    FontSize="16"
155 172
                     Text="视频名称" Foreground="White" />
156
-                    <TextBlock
173
+                                                                                        <!--<TextBlock
157 174
                     HorizontalAlignment="Center"
158 175
                     VerticalAlignment="Center"
159 176
                     FontSize="15"
160
-                    Text="视频时长" Foreground="White" />
161
-                    <TextBlock
177
+                    Text="视频时长" Foreground="White" />-->
178
+                                                                                        <TextBlock
162 179
                     HorizontalAlignment="Center"
163 180
                     VerticalAlignment="Center"
164
-                    FontSize="15"
181
+                    FontSize="16"
165 182
                     Text="视频大小" Foreground="White" />
166
-                    <TextBlock
183
+                                                                                        <TextBlock
167 184
                     HorizontalAlignment="Center"
168 185
                     VerticalAlignment="Center"
169
-                    FontSize="15"
186
+                    FontSize="16"
170 187
                     Text="日期" Foreground="White" />
171
-                    <TextBlock
188
+                                                                                        <TextBlock
172 189
                     HorizontalAlignment="Center"
173 190
                     VerticalAlignment="Center"
174
-                    FontSize="15"
191
+                    FontSize="16"
175 192
                     Text="操作" Foreground="White" />
176
-                </UniformGrid>
177
-                <ListBox Grid.Row="1"
193
+                                                                                    </UniformGrid>
194
+                                                                                    <ListBox Grid.Row="1"
178 195
                     x:Name="listView1"
179 196
                     BorderThickness="0"
180 197
                     FontSize="20"
@@ -183,33 +200,41 @@
183 200
                     ItemsSource="{Binding menuList}" 
184 201
                            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
185 202
                                 ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
186
-            </Grid>
187
-            <!--第三行 删除 上传 按钮-->
188
-            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" Height="32">
189
-                <TextBlock Text="共" FontSize="20" Padding="0,5,0,0"/>
190
-                <TextBlock x:Name="txbSum" Text="0" FontSize="20" Padding="0,5,0,0"/>
191
-                <TextBlock Text="条" FontSize="20" Padding="0,5,0,0"/>
192
-                <Button Background="Transparent"
193
-                                Cursor="Hand"
194
-                        BorderThickness="0">
195
-                    <Image Source="./Images/class_p1.png"/>
196
-                </Button>
197
-                <Button Background="Transparent"
198
-                                Cursor="Hand"
199
-                        BorderThickness="0" Content="1" FontSize="20" Width="30"/>
200
-                <Button Background="Transparent"
203
+                                                                                </Grid>
204
+                                                                                <!--第三行 删除 上传 按钮-->
205
+                                                                                <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Height="32">
206
+                                                                                    <TextBlock Text="共" FontSize="20" Padding="0,5,0,0"/>
207
+                                                                                    <TextBlock x:Name="txbSum" Text="0" FontSize="20" Padding="0,5,0,0"/>
208
+                                                                                    <TextBlock Text="条" FontSize="20" Padding="0,5,0,0"/>
209
+                                                                                    <Button Background="Transparent"
201 210
                                 Cursor="Hand"
202
-                        BorderThickness="0" Content="2" FontSize="20" Width="30"/>
203
-                <Button Background="Transparent"
211
+                        BorderThickness="0" Content="上一页" FontSize="20" Margin="10,0,0,0" >
212
+                                                                                        <!--<Image Source="./Images/class_p1.png"/>-->
213
+                                                                                    </Button>
214
+                                                                                    <Button Background="Transparent"
204 215
                                 Cursor="Hand"
205
-                        BorderThickness="0" Content="3" FontSize="20" Width="30"/>
206
-                <Button Background="Transparent"
207
-                                Cursor="Hand"
208
-                        BorderThickness="0">
209
-                    <Image Source="./Images/class_p2.png"/>
210
-                </Button>
211
-            </StackPanel>
212
-            
213
-        </Grid>
216
+                        BorderThickness="0" Content="下一页" FontSize="20" Margin="10,0,0,0" >
217
+                                                                                        <!--<Image Source="./Images/class_p2.png"/>-->
218
+                                                                                    </Button>
219
+                                                                                </StackPanel>
220
+
221
+                                                                            </Grid>
222
+                                                                        </Border>
223
+                                                                    </Border>
224
+                                                                </Border>
225
+                                                            </Border>
226
+                                                        </Border>
227
+                                                    </Border>
228
+                                                </Border>
229
+                                            </Border>
230
+                                        </Border>
231
+                                    </Border>
232
+                                </Border>
233
+                            </Border>
234
+                        </Border>
235
+                    </Border>
236
+                </Border>
237
+            </Border>
238
+        </Border>
214 239
     </Viewbox>
215 240
 </Window>

+ 25
- 17
XHWK.WKTool/FileDirectoryWindow.xaml.cs Ver fichero

@@ -50,6 +50,7 @@ namespace XHWK.WKTool
50 50
         /// </summary>
51 51
         public void Initialize()
52 52
         {
53
+            APP.myloading.Show();
53 54
             MouseNumber = 0;
54 55
             IsModify = false;
55 56
             //加载视频列表
@@ -91,26 +92,33 @@ namespace XHWK.WKTool
91 92
                     vis = "Collapsed";
92 93
                     cos = "Visible";
93 94
                 }
94
-                pageData.menuList.Add(new FileDirectoryModel()
95
+                if (i <= 16)
95 96
                 {
96
-                    SerialNumber = i,
97
-                    VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
98
-                    Name = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
99
-                    FilePath = videoinfo.VideoPath.Replace(FileToolsCommon.GetIOFileName(videoinfo.VideoPath), "").Trim(),
100
-                    VideoDuration = 0,
101
-                    VideoSize = videoinfo.VideoSize,
102
-                    VideoTime = videoinfo.RSTime,
103
-                    IsEnabled = false,
104
-                    Path = videoinfo.VideoPath,
105
-                    Colour = colour,
106
-                    Visi = vis,
107
-                    Coll = cos,
108
-                    FileGuid = videoinfo.FileGuid,
109
-                    VideoType = videoinfo.VideoType.ToString()
110
-                }); ;
97
+                    pageData.menuList.Add(new FileDirectoryModel()
98
+                    {
99
+                        SerialNumber = i,
100
+                        VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
101
+                        Name = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
102
+                        FilePath = videoinfo.VideoPath.Replace(FileToolsCommon.GetIOFileName(videoinfo.VideoPath), "").Trim(),
103
+                        VideoDuration = 0,
104
+                        VideoSize = videoinfo.VideoSize,
105
+                        VideoTime = videoinfo.RSTime,
106
+                        IsEnabled = false,
107
+                        Path = videoinfo.VideoPath,
108
+                        Colour = colour,
109
+                        Visi = vis,
110
+                        Coll = cos,
111
+                        FileGuid = videoinfo.FileGuid,
112
+                        VideoType = videoinfo.VideoType.ToString()
113
+                    }); ;
114
+                }
115
+
116
+
117
+
111 118
                 i++;
112 119
             }
113 120
             txbSum.Text = pageData.menuList.Count.ToString();
121
+            APP.myloading.Hide();
114 122
             DataContext = pageData;
115 123
         }
116 124
         /// <summary>
@@ -210,7 +218,7 @@ namespace XHWK.WKTool
210 218
         /// <param name="e"></param>
211 219
         private void BtnDelete_Click(object sender, RoutedEventArgs e)
212 220
         {
213
-        
221
+
214 222
             pageData.menuList[Subscript].IsEnabled = false;
215 223
             List<Button> buttons = FindChilds<Button>(listView1, "btnDelete");
216 224
             for (int i = 0; i < buttons.Count; i++)

BIN
XHWK.WKTool/Images/img_load.gif Ver fichero


+ 10
- 8
XHWK.WKTool/JieTuWindow.xaml.cs Ver fichero

@@ -81,7 +81,8 @@ namespace ComeCapture
81 81
                 Directory.CreateDirectory(tempPath);
82 82
             }
83 83
             string imagePath = Path.Combine(tempPath, time + ".jpg");
84
-            Background = new ImageBrush(ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), null));
84
+            if (ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), null, true, out BitmapImage bitmap))
85
+                Background = new ImageBrush(bitmap);
85 86
         }
86 87
 
87 88
         public void initialization()
@@ -233,7 +234,7 @@ namespace ComeCapture
233 234
             //string imagePath = ImageHelper.GetImagePath(out string serverSavePath);
234 235
 
235 236
             //BitmapSource bitmap = ImageHelper.GetBitmapSource((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2, out JieTuBitmapPtr);
236
-            BitmapImage bitmap = ImageHelper.GetScreenshot(new Rectangle((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2), imagePath);
237
+           /* BitmapImage bitmap = */ImageHelper.GetScreenshot(new Rectangle((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2), imagePath,true,out BitmapImage bitmapimg);
237 238
             _IsMouseDown = false;
238 239
             _IsCapture = false;
239 240
             ImageEditBar.Current.Visibility = Visibility.Collapsed;
@@ -241,18 +242,19 @@ namespace ComeCapture
241 242
             SizeRGB.Visibility = Visibility.Collapsed;
242 243
             MainImage.Visibility = Visibility.Collapsed;
243 244
             DataContext = new AppModel();
244
-            Background = new ImageBrush(ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), imagePath));//zxy
245
+            ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);//zxy
246
+            Background = new ImageBrush(bitmap);
245 247
             WpfHelper.MainDispatcher = Dispatcher;
246 248
             MaxWindow();
247 249
             MaskLeft.Height = ScreenHeight;
248 250
             MaskRight.Height = ScreenHeight;
249 251
             //计算Windows项目缩放比例
250 252
             ScreenHelper.ResetScreenScale();
251
-            if (bitmap != null)
252
-            {
253
-                //Shared.TeachingData.REQ_InteractiveLaunch.teacherpic = serverSavePath;
254
-                //Shared.TeachingData.FilePath = imagePath;
255
-            }
253
+            //if (bitmap != null)
254
+            //{
255
+            //    //Shared.TeachingData.REQ_InteractiveLaunch.teacherpic = serverSavePath;
256
+            //    //Shared.TeachingData.FilePath = imagePath;
257
+            //}
256 258
 
257 259
             ///修改为统一截图时存储到服务器 修改人:赵耀 修改时间:2020年8月11日
258 260
             //if (bitmap != null)

+ 239
- 0
XHWK.WKTool/LoadDialog.xaml Ver fichero

@@ -0,0 +1,239 @@
1
+<Window x:Class="XHWK.WKTool.LoadDialog"
2
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
+        xmlns:local="clr-namespace:XHWK.WKTool"
7
+        mc:Ignorable="d"
8
+        Title="LoadDialog"  Width="100"
9
+    Height="100"
10
+    AllowsTransparency="True"
11
+    Background="Transparent"
12
+    Opacity="1"
13
+    ResizeMode="NoResize"
14
+    Topmost="True"
15
+    WindowStartupLocation="CenterScreen"
16
+    WindowStyle="None">
17
+    <Grid>
18
+        <Border Background="#66000000" CornerRadius="10 10 10 10">
19
+            <Grid Width="60" Height="60">
20
+                <Grid.Resources>
21
+                    <DrawingBrush
22
+                        x:Key="brush"
23
+                        AlignmentX="Center"
24
+                        AlignmentY="Top"
25
+                        Stretch="None">
26
+                        <DrawingBrush.Drawing>
27
+                            <GeometryDrawing Brush="White">
28
+                                <GeometryDrawing.Geometry>
29
+                                    <EllipseGeometry RadiusX="2" RadiusY="5" />
30
+                                </GeometryDrawing.Geometry>
31
+                            </GeometryDrawing>
32
+                        </DrawingBrush.Drawing>
33
+                    </DrawingBrush>
34
+                </Grid.Resources>
35
+
36
+                <Rectangle
37
+                    x:Name="r01"
38
+                    Fill="{StaticResource brush}"
39
+                    Opacity="0.8"
40
+                    RenderTransformOrigin="0.5,0.5">
41
+                    <Rectangle.RenderTransform>
42
+                        <RotateTransform Angle="0" />
43
+                    </Rectangle.RenderTransform>
44
+                </Rectangle>
45
+                <Rectangle
46
+                    x:Name="r02"
47
+                    Fill="{StaticResource brush}"
48
+                    Opacity="0.8"
49
+                    RenderTransformOrigin="0.5,0.5">
50
+                    <Rectangle.RenderTransform>
51
+                        <RotateTransform Angle="30" />
52
+                    </Rectangle.RenderTransform>
53
+                </Rectangle>
54
+                <Rectangle
55
+                    x:Name="r03"
56
+                    Fill="{StaticResource brush}"
57
+                    Opacity="0.8"
58
+                    RenderTransformOrigin="0.5,0.5">
59
+                    <Rectangle.RenderTransform>
60
+                        <RotateTransform Angle="60" />
61
+                    </Rectangle.RenderTransform>
62
+                </Rectangle>
63
+                <Rectangle
64
+                    x:Name="r04"
65
+                    Fill="{StaticResource brush}"
66
+                    Opacity="0.8"
67
+                    RenderTransformOrigin="0.5,0.5">
68
+                    <Rectangle.RenderTransform>
69
+                        <RotateTransform Angle="90" />
70
+                    </Rectangle.RenderTransform>
71
+                </Rectangle>
72
+                <Rectangle
73
+                    x:Name="r05"
74
+                    Fill="{StaticResource brush}"
75
+                    Opacity="0.8"
76
+                    RenderTransformOrigin="0.5,0.5">
77
+                    <Rectangle.RenderTransform>
78
+                        <RotateTransform Angle="120" />
79
+                    </Rectangle.RenderTransform>
80
+                </Rectangle>
81
+                <Rectangle
82
+                    x:Name="r06"
83
+                    Fill="{StaticResource brush}"
84
+                    Opacity="0.8"
85
+                    RenderTransformOrigin="0.5,0.5">
86
+                    <Rectangle.RenderTransform>
87
+                        <RotateTransform Angle="150" />
88
+                    </Rectangle.RenderTransform>
89
+                </Rectangle>
90
+                <Rectangle
91
+                    x:Name="r07"
92
+                    Fill="{StaticResource brush}"
93
+                    Opacity="0.8"
94
+                    RenderTransformOrigin="0.5,0.5">
95
+                    <Rectangle.RenderTransform>
96
+                        <RotateTransform Angle="180" />
97
+                    </Rectangle.RenderTransform>
98
+                </Rectangle>
99
+                <Rectangle
100
+                    x:Name="r08"
101
+                    Fill="{StaticResource brush}"
102
+                    Opacity="0.8"
103
+                    RenderTransformOrigin="0.5,0.5">
104
+                    <Rectangle.RenderTransform>
105
+                        <RotateTransform Angle="210" />
106
+                    </Rectangle.RenderTransform>
107
+                </Rectangle>
108
+                <Rectangle
109
+                    x:Name="r09"
110
+                    Fill="{StaticResource brush}"
111
+                    Opacity="0.8"
112
+                    RenderTransformOrigin="0.5,0.5">
113
+                    <Rectangle.RenderTransform>
114
+                        <RotateTransform Angle="240" />
115
+                    </Rectangle.RenderTransform>
116
+                </Rectangle>
117
+                <Rectangle
118
+                    x:Name="r10"
119
+                    Fill="{StaticResource brush}"
120
+                    Opacity="0.8"
121
+                    RenderTransformOrigin="0.5,0.5">
122
+                    <Rectangle.RenderTransform>
123
+                        <RotateTransform Angle="270" />
124
+                    </Rectangle.RenderTransform>
125
+                </Rectangle>
126
+                <Rectangle
127
+                    x:Name="r11"
128
+                    Fill="{StaticResource brush}"
129
+                    Opacity="0.8"
130
+                    RenderTransformOrigin="0.5,0.5">
131
+                    <Rectangle.RenderTransform>
132
+                        <RotateTransform Angle="300" />
133
+                    </Rectangle.RenderTransform>
134
+                </Rectangle>
135
+                <Rectangle
136
+                    x:Name="r12"
137
+                    Fill="{StaticResource brush}"
138
+                    Opacity="0.8"
139
+                    RenderTransformOrigin="0.5,0.5">
140
+                    <Rectangle.RenderTransform>
141
+                        <RotateTransform Angle="330" />
142
+                    </Rectangle.RenderTransform>
143
+                </Rectangle>
144
+                <Grid.Triggers>
145
+                    <EventTrigger RoutedEvent="Grid.Loaded">
146
+                        <BeginStoryboard>
147
+                            <Storyboard RepeatBehavior="Forever">
148
+                                <DoubleAnimation
149
+                                    AutoReverse="True"
150
+                                    BeginTime="0:0:0.00000"
151
+                                    Storyboard.TargetName="r01"
152
+                                    Storyboard.TargetProperty="Opacity"
153
+                                    To="0"
154
+                                    Duration="0:0:0.08333" />
155
+                                <DoubleAnimation
156
+                                    AutoReverse="True"
157
+                                    BeginTime="0:0:0.08333"
158
+                                    Storyboard.TargetName="r02"
159
+                                    Storyboard.TargetProperty="Opacity"
160
+                                    To="0"
161
+                                    Duration="0:0:0.08333" />
162
+                                <DoubleAnimation
163
+                                    AutoReverse="True"
164
+                                    BeginTime="0:0:0.16666"
165
+                                    Storyboard.TargetName="r03"
166
+                                    Storyboard.TargetProperty="Opacity"
167
+                                    To="0"
168
+                                    Duration="0:0:0.08333" />
169
+                                <DoubleAnimation
170
+                                    AutoReverse="True"
171
+                                    BeginTime="0:0:0.24999"
172
+                                    Storyboard.TargetName="r04"
173
+                                    Storyboard.TargetProperty="Opacity"
174
+                                    To="0"
175
+                                    Duration="0:0:0.08333" />
176
+                                <DoubleAnimation
177
+                                    AutoReverse="True"
178
+                                    BeginTime="0:0:0.33332"
179
+                                    Storyboard.TargetName="r05"
180
+                                    Storyboard.TargetProperty="Opacity"
181
+                                    To="0"
182
+                                    Duration="0:0:0.08333" />
183
+                                <DoubleAnimation
184
+                                    AutoReverse="True"
185
+                                    BeginTime="0:0:0.41665"
186
+                                    Storyboard.TargetName="r06"
187
+                                    Storyboard.TargetProperty="Opacity"
188
+                                    To="0"
189
+                                    Duration="0:0:0.08333" />
190
+                                <DoubleAnimation
191
+                                    AutoReverse="True"
192
+                                    BeginTime="0:0:0.49998"
193
+                                    Storyboard.TargetName="r07"
194
+                                    Storyboard.TargetProperty="Opacity"
195
+                                    To="0"
196
+                                    Duration="0:0:0.08333" />
197
+                                <DoubleAnimation
198
+                                    AutoReverse="True"
199
+                                    BeginTime="0:0:0.58331"
200
+                                    Storyboard.TargetName="r08"
201
+                                    Storyboard.TargetProperty="Opacity"
202
+                                    To="0"
203
+                                    Duration="0:0:0.08333" />
204
+                                <DoubleAnimation
205
+                                    AutoReverse="True"
206
+                                    BeginTime="0:0:0.66664"
207
+                                    Storyboard.TargetName="r09"
208
+                                    Storyboard.TargetProperty="Opacity"
209
+                                    To="0"
210
+                                    Duration="0:0:0.08333" />
211
+                                <DoubleAnimation
212
+                                    AutoReverse="True"
213
+                                    BeginTime="0:0:0.74997"
214
+                                    Storyboard.TargetName="r10"
215
+                                    Storyboard.TargetProperty="Opacity"
216
+                                    To="0"
217
+                                    Duration="0:0:0.08333" />
218
+                                <DoubleAnimation
219
+                                    AutoReverse="True"
220
+                                    BeginTime="0:0:0.83330"
221
+                                    Storyboard.TargetName="r11"
222
+                                    Storyboard.TargetProperty="Opacity"
223
+                                    To="0"
224
+                                    Duration="0:0:0.08333" />
225
+                                <DoubleAnimation
226
+                                    AutoReverse="True"
227
+                                    BeginTime="0:0:0.91663"
228
+                                    Storyboard.TargetName="r12"
229
+                                    Storyboard.TargetProperty="Opacity"
230
+                                    To="0"
231
+                                    Duration="0:0:0.08333" />
232
+                            </Storyboard>
233
+                        </BeginStoryboard>
234
+                    </EventTrigger>
235
+                </Grid.Triggers>
236
+            </Grid>
237
+        </Border>
238
+    </Grid>
239
+</Window>

+ 27
- 0
XHWK.WKTool/LoadDialog.xaml.cs Ver fichero

@@ -0,0 +1,27 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using System.Windows;
7
+using System.Windows.Controls;
8
+using System.Windows.Data;
9
+using System.Windows.Documents;
10
+using System.Windows.Input;
11
+using System.Windows.Media;
12
+using System.Windows.Media.Imaging;
13
+using System.Windows.Shapes;
14
+
15
+namespace XHWK.WKTool
16
+{
17
+    /// <summary>
18
+    /// LoadDialog.xaml 的交互逻辑
19
+    /// </summary>
20
+    public partial class LoadDialog : Window
21
+    {
22
+        public LoadDialog()
23
+        {
24
+            InitializeComponent();
25
+        }
26
+    }
27
+}

+ 43
- 9
XHWK.WKTool/LoginWindow.xaml Ver fichero

@@ -5,12 +5,29 @@
5 5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6 6
         xmlns:local="clr-namespace:XHWK.WKTool"
7 7
         mc:Ignorable="d"
8
-        Title="LoginWindow" Height="341" Width="454"   AllowsTransparency="True"
8
+        Title="LoginWindow" Height="358" Width="471"   AllowsTransparency="True"
9 9
     ShowInTaskbar="False"
10 10
     WindowStartupLocation="CenterOwner"
11 11
     WindowStyle="None">
12 12
     <Viewbox>
13
-        <Grid Height="341" Width="454" >
13
+        <Border Background="#fefefe" Height="358" Width="471">
14
+            <Border Background="#fdfdfd" Height="357" Width="470">
15
+                <Border Background="#fcfcfc" Height="356" Width="469">
16
+                    <Border Background="#fafafa" Height="355" Width="468">
17
+                        <Border Background="#f9f9f9" Height="354" Width="467">
18
+                            <Border Background="#f6f6f6" Height="353" Width="466">
19
+                                <Border Background="#f3f3f3" Height="352" Width="465">
20
+                                    <Border Background="#eeeeee" Height="351" Width="464">
21
+                                        <Border Background="#e9e9e9" Height="350" Width="463">
22
+                                            <Border Background="#e2e2e2" Height="349" Width="462">
23
+                                                <Border Background="#dcdcdc" Height="348" Width="461">
24
+                                                    <Border Background="#d3d3d3" Height="347" Width="460">
25
+                                                        <Border Background="#cccccc" Height="346" Width="459">
26
+                                                            <Border Background="#bfbfbf" Height="345" Width="458">
27
+                                                                <Border Background="#aeaeae" Height="344" Width="457">
28
+                                                                    <Border Background="#bababa" Height="343" Width="456">
29
+                                                                        <!--<Border Background="#e4e4e4" Height="342" Width="455">-->
30
+                                                                        <Grid Height="343" Width="456" Background="#FFFFFF">
14 31
             <!--分5行-->
15 32
             <Grid.RowDefinitions>
16 33
                 <RowDefinition Height="45"/>
@@ -30,19 +47,19 @@
30 47
             <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="20,20,0,0">
31 48
                 <TextBlock Text="登陆" FontSize="18" Padding="2,15,10,0"/>
32 49
                 <!--输入框-->
33
-                <Border Background="#CDD6E0" Width="371" Height="43" CornerRadius="3">
34
-                    <TextBox x:Name="txbAccountNumber" Text="" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="369" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
50
+                                                                                <Border Background="#cccbce" Width="371" Height="43" CornerRadius="3">
51
+                    <TextBox x:Name="txbAccountNumber" Text="" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="369" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
35 52
                 </Border>
36 53
             </StackPanel>
37 54
             <!--第三行 密码-->
38 55
             <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="20,20,0,0">
39 56
                 <TextBlock Text="密码" FontSize="18" Padding="2,15,10,0"/>
40 57
                 <!--输入框-->
41
-                <Border Background="#CDD6E0" Width="371" Height="43" CornerRadius="3">
42
-                    <PasswordBox x:Name="pobPassword" FontSize="16" Foreground="#333333" PasswordChar="*" Padding="5,12,2,2" Width="369" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
58
+                                                                                <Border Background="#cccbce" Width="371" Height="43" CornerRadius="3">
59
+                    <PasswordBox x:Name="pobPassword" FontSize="16" Foreground="#333333" PasswordChar="*" Padding="5,12,2,2" Width="369" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
43 60
                 </Border>
44 61
             </StackPanel>
45
-            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="20,0,0,0">
62
+            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="20,10,0,0">
46 63
                 <Viewbox Height="23">
47 64
                     <CheckBox   x:Name="ckSaveName" Click="CkSaveName_Click"/>
48 65
                 </Viewbox>
@@ -50,13 +67,13 @@
50 67
             </StackPanel>
51 68
             
52 69
             <!--第五行 开始按钮-->
53
-            <Button  Cursor="Hand" Grid.Row="4" x:Name="btnStart" Content="登录" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="43" Margin="10,0,10,0" Click="BtnStart_Click">
70
+            <Button  Cursor="Hand" Grid.Row="4" x:Name="btnStart" Content="登录" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="50" Margin="10,0,10,0" Click="BtnStart_Click">
54 71
                 <Button.Template>
55 72
                     <ControlTemplate TargetType="{x:Type Button}">
56 73
                         <Border
57 74
                                 BorderBrush="{TemplateBinding Control.BorderBrush}"
58 75
                                 BorderThickness="1"
59
-                                CornerRadius="2">
76
+                                CornerRadius="7">
60 77
                             <Border.Background>#2D8CF0</Border.Background>
61 78
                             <ContentPresenter
62 79
                                     HorizontalAlignment="Center"
@@ -67,5 +84,22 @@
67 84
                 </Button.Template>
68 85
             </Button>
69 86
         </Grid>
87
+                                                                        </Border>
88
+                                                                    </Border>
89
+                                                                </Border>
90
+                                                            </Border>
91
+                                                        </Border>
92
+                                                    </Border>
93
+                                                </Border>
94
+                                            </Border>
95
+                                        </Border>
96
+                                    </Border>
97
+                                </Border>
98
+                            </Border>
99
+                        </Border>
100
+                    </Border>
101
+                </Border>
102
+            </Border>
103
+        <!--</Border>-->
70 104
     </Viewbox>
71 105
 </Window>

+ 3
- 1
XHWK.WKTool/LoginWindow.xaml.cs Ver fichero

@@ -68,6 +68,7 @@ namespace XHWK.WKTool
68 68
                 MessageBox.Show("密码未输入");
69 69
                 return;
70 70
             }
71
+            APP.myloading.Show();
71 72
             Login();
72 73
         }
73 74
         /// <summary>
@@ -99,7 +100,7 @@ namespace XHWK.WKTool
99 100
                     System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放账号
100 101
                 }
101 102
 
102
-
103
+                APP.myloading.Hide();
103 104
                 //UpdateSettingString("userName", txbAccountNumber.Text);
104 105
                 APP.IsLoginType = true;
105 106
                 txbAccountNumber.Text = string.Empty;
@@ -131,6 +132,7 @@ namespace XHWK.WKTool
131 132
             }
132 133
             else
133 134
             {
135
+                APP.myloading.Hide();
134 136
                 MessageBox.Show(APP.ServerMsg);
135 137
             }
136 138
         }

+ 4
- 4
XHWK.WKTool/PracticeWindow.xaml.cs Ver fichero

@@ -33,7 +33,7 @@ namespace XHWK.WKTool
33 33
         /// <summary>
34 34
         /// 当前画笔颜色
35 35
         /// </summary>
36
-        Color Colour=Colors.Black;
36
+        Color Colour=Colors.Red;
37 37
         /// <summary>
38 38
         /// 当前画笔宽
39 39
         /// </summary>
@@ -111,15 +111,15 @@ namespace XHWK.WKTool
111 111
             Colour = Colors.Red;
112 112
         }
113 113
         /// <summary>
114
-        /// 画笔颜色事件 
114
+        /// 画笔颜色事件 
115 115
         /// </summary>
116 116
         /// <param name="sender"></param>
117 117
         /// <param name="e"></param>
118 118
         public void Gray()
119 119
         {
120 120
             //flg = 0;
121
-            drawingAttributes.Color = Colors.Gray;
122
-            Colour = Colors.Gray;
121
+            drawingAttributes.Color = Colors.Black;
122
+            Colour = Colors.Black;
123 123
         }
124 124
         /// <summary>
125 125
         /// 画笔颜色事件 青色

+ 4
- 4
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml Ver fichero

@@ -13,7 +13,7 @@
13 13
         <SolidColorBrush Opacity="0" Color="#292C2E" />
14 14
     </Window.Background>
15 15
     <Viewbox>
16
-        <Grid>
16
+        <Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown">
17 17
             <Grid.RowDefinitions>
18 18
                 <RowDefinition Height="auto"/>
19 19
                 <RowDefinition Height="auto"/>
@@ -21,7 +21,7 @@
21 21
             <Image x:Name="imgCanvas" Visibility="Collapsed"/>
22 22
             <InkCanvas Grid.Row="0" x:Name="blackboard_canvas" Background="Transparent" Visibility="Collapsed" Grid.RowSpan="2" />
23 23
             <!--画笔工具栏-->
24
-            <Grid Grid.Row="0" x:Name="gridToolbar" Visibility="Visible">
24
+            <Grid Grid.Row="0" x:Name="gridToolbar" Visibility="Collapsed">
25 25
                 <Image Grid.Row="0"  Source="./Images/Toobar22.png" HorizontalAlignment="Right"/>
26 26
                 <StackPanel Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Right" Margin="0,5,10,0">
27 27
                     <Button  Cursor="Hand" x:Name="btnToolbarDown" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,5,0,0" Click="BtnToolbarDown_Click">
@@ -51,7 +51,7 @@
51 51
                 </StackPanel>
52 52
             </Grid>
53 53
             <!--字体颜色-->
54
-            <Grid Grid.Row="0" x:Name="gridColour" Visibility="Visible">
54
+            <Grid Grid.Row="0" x:Name="gridColour" Visibility="Collapsed">
55 55
                 <Image Source="./Images/Toobar20.png" HorizontalAlignment="Right" Margin="0,200,62,0"/>
56 56
                 <StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="0,215,68,0">
57 57
                     <Button  Cursor="Hand" x:Name="btnWhite" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Background="#FFFFFF" Height="15" Width="15" Margin="0,0,0,0" Click="BtnWhite_Click"/>
@@ -81,7 +81,7 @@
81 81
                 <Button x:Name="BtnStopRecordingScreen" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,15,0" Click="BtnStopRecordingScreen_Click">
82 82
                     <Image x:Name="ImgEndRecordingScreen" Source="./Images/Toobar14.png"/>
83 83
                 </Button>
84
-                <Button  Cursor="Hand" x:Name="btnBrush" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnBrush_Click">
84
+                <Button  Cursor="Hand" x:Name="btnBlackPen" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnBlackPen_Click">
85 85
                     <Image Source="./Images/Toobar8.png"/>
86 86
                 </Button>
87 87
             </StackPanel>

+ 18
- 1
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs Ver fichero

@@ -371,7 +371,7 @@ namespace XHWK.WKTool
371 371
                 Directory.CreateDirectory(tempPath);
372 372
             }
373 373
             string imagePath = Path.Combine(tempPath, time + ".jpg");
374
-            ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath);
374
+            //ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath);
375 375
             if (gridToolbar.Visibility == Visibility.Visible)
376 376
             {
377 377
                 gridToolbar.Visibility = Visibility.Hidden;
@@ -590,6 +590,23 @@ namespace XHWK.WKTool
590 590
         /// 停止录屏
591 591
         /// </summary>
592 592
         public event StopRecordingScreen Click_stopRecordingScreen;
593
+        /// <summary>
594
+        /// 黑笔
595
+        /// </summary>
596
+        /// <param name="sender"></param>
597
+        /// <param name="e"></param>
598
+        private void BtnBlackPen_Click(object sender, RoutedEventArgs e)
599
+        {
593 600
 
601
+        }
602
+        /// <summary>
603
+        /// 移动工具栏
604
+        /// </summary>
605
+        /// <param name="sender"></param>
606
+        /// <param name="e"></param>
607
+        private void Grid_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
608
+        {
609
+            DragMove();
610
+        }
594 611
     }
595 612
 }

+ 67
- 56
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Ver fichero

@@ -5,6 +5,7 @@
5 5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6 6
          xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
7 7
         xmlns:aforge ="clr-namespace:AForge.Controls;assembly=AForge.Controls"
8
+        xmlns:gifLib="http://wpfanimatedgif.codeplex.com"
8 9
         xmlns:local="clr-namespace:XHWK.WKTool"
9 10
         mc:Ignorable="d"
10 11
         Title="星火微课系统" Height="1040" Width="1276" WindowStartupLocation="CenterScreen"
@@ -29,11 +30,12 @@
29 30
     </Window.BorderBrush>
30 31
 
31 32
     <Viewbox>
32
-        <Grid x:Name="GridContent" Height="1040">
33
+        <Border Background="#cdcdcd" Height="1040" Width="1280">
34
+            <Grid x:Name="GridContent" Height="1036" Width="1276">
33 35
 
34 36
             <!--分3行-->
35 37
             <Grid.RowDefinitions>
36
-                <RowDefinition Height="110"/>
38
+                <RowDefinition Height="106"/>
37 39
                 <RowDefinition Height="*"/>
38 40
                 <RowDefinition Height="40"/>
39 41
             </Grid.RowDefinitions>
@@ -101,6 +103,7 @@
101 103
                             <TextBlock Text="停止" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
102 104
                         </StackPanel>
103 105
                     </Button>
106
+                    <TextBlock x:Name="txbType" Text="" FontSize="20" Foreground="#FFFFFF" Margin="20,20,0,0"/>
104 107
                 </StackPanel>
105 108
                 <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,10,0">
106 109
                     <Button Cursor="Hand" x:Name="btnAdd" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnAdd_Click" Margin="0,0,30,0">
@@ -117,12 +120,19 @@
117 120
                             <TextBlock Text="打印" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
118 121
                         </StackPanel>
119 122
                     </Button>
120
-                    <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click" Margin="0,0,30,0">
123
+                    <!--<Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click" Margin="0,0,30,0">
121 124
                         <StackPanel Orientation="Vertical">
122 125
                             <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
123 126
                             <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_16.png" Visibility="Visible"/>
124 127
                             <TextBlock Text="上传" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
125 128
                         </StackPanel>
129
+                    </Button>-->
130
+                    <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnUpload_Click">
131
+                        <StackPanel Orientation="Vertical">
132
+                            <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_22.png" Visibility="Collapsed"/>
133
+                            <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_1.png" Visibility="Visible"/>
134
+                            <TextBlock Text="我的" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
135
+                        </StackPanel>
126 136
                     </Button>
127 137
                     <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnSetUp_Click">
128 138
                         <StackPanel Orientation="Vertical">
@@ -134,65 +144,66 @@
134 144
                 </StackPanel>
135 145
             </Grid>
136 146
             <!--主内容-->
137
-            <Grid Grid.Row="1" x:Name="GridMain" Width="1276">
138
-                <ScrollViewer x:Name="scroMain" VerticalScrollBarVisibility="Visible">
139
-                    <Grid x:Name="gridM"  Margin="0,0,0,0" Background="#FFFFFF" Visibility="Visible" Height="1780">
140
-                        <Grid>
141
-                            <Border Grid.Row="1"  CornerRadius="5">
142
-                                <Grid x:Name="IMG" Margin="0,0,0,0">
143
-                                    <Grid.Resources>
144
-                                        <TransformGroup x:Key="Imageview">
145
-                                            <ScaleTransform/>
146
-                                            <TranslateTransform/>
147
-                                        </TransformGroup>
148
-                                    </Grid.Resources>
147
+                <Grid Grid.Row="1" x:Name="GridMain" Width="1276" >
148
+                    <ScrollViewer x:Name="scroMain" VerticalScrollBarVisibility="Visible">
149
+                        <Grid x:Name="gridM"  Margin="0,0,0,0" Background="#FFFFFF" Visibility="Visible" Height="1780">
150
+                            <Grid>
151
+                                <Border Grid.Row="1"  CornerRadius="5">
152
+                                    <Grid x:Name="IMG" Margin="0,0,0,0">
153
+                                        <Grid.Resources>
154
+                                            <TransformGroup x:Key="Imageview">
155
+                                                <ScaleTransform/>
156
+                                                <TranslateTransform/>
157
+                                            </TransformGroup>
158
+                                        </Grid.Resources>
149 159
 
150
-                                    <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"   Cursor="SizeAll"
160
+                                        <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"   Cursor="SizeAll"
151 161
                   Margin="0,0,0,0" Focusable="False" x:Name="BackFrame">
152
-                                        <ContentControl  MouseLeftButtonDown="IMG1_MouseLeftButtonDown"   
162
+                                            <ContentControl  MouseLeftButtonDown="IMG1_MouseLeftButtonDown"   
153 163
                              MouseLeftButtonUp="IMG1_MouseLeftButtonUp"
154 164
                              MouseMove="IMG1_MouseMove"
155 165
                              MouseWheel="IMG1_MouseWheel" >
156
-                                            <Image Name="imgCanvas" Width="635" Height="auto" Stretch="Uniform" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}">
157
-                                            </Image>
158
-                                        </ContentControl>
159
-                                    </ScrollViewer>
160
-                                </Grid>
161
-                            </Border>
162
-                        </Grid>
163
-                        <Image x:Name="imgDocumentation"/>
164
-                        <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
165
-                        <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
166
-                        <!--摄像头-->
167
-                        <!--<wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Height="124" Width="172" HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top">
166
+                                                <Image Name="imgCanvas" Width="635" Height="auto" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Uniform" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseRightButtonDown="imgCanvas_MouseRightButtonDown">
167
+                                                </Image>
168
+                                            </ContentControl>
169
+                                        </ScrollViewer>
170
+                                    </Grid>
171
+                                </Border>
172
+                            </Grid>
173
+                            <!--导入图片-->
174
+                            <Image x:Name="imgDocumentation"/>
175
+                            <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
176
+                            <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
177
+                            <!--摄像头-->
178
+                            <!--<wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Height="124" Width="172" HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top">
168 179
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
169 180
                 </wfi:WindowsFormsHost>-->
170
-
171
-
172
-
173
-
174
-                    </Grid>
175
-                </ScrollViewer>
176
-                <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
177
-                <Image x:Name="imgPlayerRight" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right"  Margin="10,7,26,10" VerticalAlignment="Top" Visibility="Collapsed"/>
178
-                <Image x:Name="imgPlayerLeftUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
179
-                <Image x:Name="imgPlayerRightUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right" Margin="10,7,26,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
180
-                <Label Content="" Grid.Column="0" Height="2" Width="2" HorizontalAlignment="Left"  VerticalAlignment="Top" Background="#FF0F0F0F" Margin="1,0,0,0"/>
181
-                <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,16,0"/>
182
-                <Label Content="" Grid.Column="0" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
183
-                <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,16,0"/>
184
-            </Grid>
185
-
186
-            <Grid Grid.Row="1">
187
-                <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#FFFFFF" Width="180" HorizontalAlignment="Center"
188
-            Height="58" Margin="0,520,0,0" Grid.Column="1" VerticalAlignment="Bottom">
181
+                            <!--<Image x:Name="imgLoad"
182
+                    Width="300"
183
+                    Height="300"
184
+                    gifLib:ImageBehavior.AnimatedSource="./Images/img_load.gif" VerticalAlignment="Top" Margin="0,200,0,0" Visibility="Visible"/>-->
185
+                        </Grid>
186
+                    </ScrollViewer>
187
+                    <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
188
+                    <Image x:Name="imgPlayerRight" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right"  Margin="10,7,26,10" VerticalAlignment="Top" Visibility="Collapsed"/>
189
+                    <Image x:Name="imgPlayerLeftUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
190
+                    <Image x:Name="imgPlayerRightUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right" Margin="10,7,26,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
191
+                    <Label Content="" Grid.Column="0" Height="2" Width="2" HorizontalAlignment="Left"  VerticalAlignment="Top" Background="#FF0F0F0F" Margin="1,0,0,0"/>
192
+                    <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,16,0"/>
193
+                    <Label Content="" Grid.Column="0" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0"/>
194
+                    <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,16,0"/>
195
+                </Grid>
196
+                <!--页码-->
197
+                <Grid Grid.Row="1" x:Name="gridPage" Visibility="Collapsed" Background="#FFFFFF">
198
+                    <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#FFFFFF" Width="180" HorizontalAlignment="Center"
199
+            Height="30" Margin="0,0,0,0" Grid.Column="1" VerticalAlignment="Bottom">
189 200
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
190 201
                     x:Name="last_button"
191
-                    Width="60" Height="50"
202
+                    Width="60" Height="20"
192 203
                     Click="last_button_Click">
193 204
                         <Button.Content>
194 205
                             <StackPanel>
195
-                                <Image Width="16" Source=".\Images\class_p1.png" />
206
+                                <Image Width="16" Height="12" Source=".\Images\class_p1.png" />
196 207
                             </StackPanel>
197 208
                         </Button.Content>
198 209
                     </Button>
@@ -201,8 +212,7 @@
201 212
                             <RowDefinition Height="311*"/>
202 213
                             <RowDefinition Height="483*"/>
203 214
                         </Grid.RowDefinitions>
204
-                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-25,0,0" Grid.Row="1"  Background="Transparent">
205
-
215
+                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-12,0,0" Grid.Row="1"  Background="Transparent">
206 216
                             <StackPanel HorizontalAlignment="Center" Orientation="Horizontal"  Background="Transparent">
207 217
                                 <TextBlock x:Name="txbCurrpage" Text="{Binding currpage}" TextAlignment="Center" FontSize="15"/>
208 218
                                 <TextBlock Text="/" TextAlignment="Center" FontSize="15"/>
@@ -212,11 +222,11 @@
212 222
                     </Grid>
213 223
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
214 224
                     x:Name="next_btn"  Background="Transparent"
215
-                    Width="60" Height="50"
225
+                    Width="60" Height="20"
216 226
                     Click="next_btn_Click">
217 227
                         <Button.Content>
218 228
                             <StackPanel>
219
-                                <Image Width="16" Source=".\Images\class_p2.png" />
229
+                                <Image Width="16" Height="12" Source=".\Images\class_p2.png" />
220 230
                             </StackPanel>
221 231
                         </Button.Content>
222 232
                     </Button>
@@ -306,12 +316,12 @@
306 316
                     </Button.Template>
307 317
                 </Button>
308 318
             </Grid>
309
-            <Grid Grid.Row="2" Background="#EFF1F8" Margin="0,2,0,0">
319
+            <Grid Grid.Row="2" Background="#EFF1F8" Margin="0,0,0,0">
310 320
                 <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
311 321
                     <TextBlock Text="颜色:" FontSize="14" Padding="10,10,0,0"/>
312 322
                     <Button Cursor="Hand" x:Name="btnWhite" Background="#FFFFFF" Width="20" Height="20" Click="BtnWhite_Click" Margin="0,2,0,0"/>
313 323
                     <Button Cursor="Hand" x:Name="btnRed" Background="#FF0000" Width="20" Height="20" Margin="5,2,0,0" Click="BtnRed_Click"/>
314
-                    <Button Cursor="Hand" x:Name="btnGray" Background="#A7A9AC" Width="20" Height="20" Margin="5,2,0,0" Click="BtnGray_Click"/>
324
+                    <Button Cursor="Hand" x:Name="btnGray" Background="#333333" Width="20" Height="20" Margin="5,2,0,0" Click="BtnGray_Click"/>
315 325
                     <Button Cursor="Hand" x:Name="btnCyanBlue" Background="#63D600" Width="20" Height="20" Margin="5,2,0,0" Click="BtnCyanBlue_Click"/>
316 326
                     <Button Cursor="Hand" x:Name="btnYellow" Background="#FFBC00" Width="20" Height="20" Margin="5,2,0,0" Click="BtnYellow_Click"/>
317 327
                     <Button Cursor="Hand" x:Name="btnBlue" Background="#00B4FC" Width="20" Height="20" Margin="5,2,0,0" Click="BtnBlue_Click"/>
@@ -331,5 +341,6 @@
331 341
                 </StackPanel>
332 342
             </Grid>
333 343
         </Grid>
344
+        </Border>
334 345
     </Viewbox>
335 346
 </Window>

+ 162
- 31
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Ver fichero

@@ -23,7 +23,7 @@ using XHWK.WKTool.DAL;
23 23
 using System.Text;
24 24
 using System.Collections.Specialized;
25 25
 using XHWK.WKTool.Config;
26
-using System.Windows.Media.Converters;
26
+using System.Windows.Threading;
27 27
 
28 28
 namespace XHWK.WKTool
29 29
 {
@@ -56,11 +56,29 @@ namespace XHWK.WKTool
56 56
         /// <summary>
57 57
         /// 当前颜色
58 58
         /// </summary>
59
-        private System.Windows.Media.Color Color = System.Windows.Media.Colors.Black;
59
+        private System.Windows.Media.Color Color = System.Windows.Media.Colors.Red;
60 60
         /// <summary>
61 61
         /// 笔迹粗细
62 62
         /// </summary>
63 63
         private int PenSize = 2;
64
+        private DispatcherTimer t = null;
65
+        /// <summary>
66
+        /// 计时器状态
67
+        /// </summary>
68
+        private enum State
69
+        {
70
+            Start,
71
+            Pause,
72
+            End
73
+        }
74
+        /// <summary>
75
+        /// 状态
76
+        /// </summary>
77
+        private State _state = State.End;
78
+        /// <summary>
79
+        /// 计时用
80
+        /// </summary>
81
+        private TimeSpan _timeSpan = new TimeSpan(0, 0, 0, 0, 0);
64 82
         #endregion
65 83
 
66 84
         #region 初始化
@@ -106,6 +124,7 @@ namespace XHWK.WKTool
106 124
             #region 数据初始化
107 125
             APP.pageData.pagenum = 0;
108 126
             APP.pageData.currpage = APP.pageData.pagenum;
127
+            btnStop.IsEnabled = false;//停止录制按钮不可点击
109 128
             #endregion
110 129
 
111 130
 
@@ -126,6 +145,63 @@ namespace XHWK.WKTool
126 145
             //wfhCamera.Visibility = Visibility.Hidden;
127 146
             ImgPDFPath = null;
128 147
             ImgPDFPath = new string[300];
148
+          
149
+        }
150
+        /// <summary>
151
+        /// 开始
152
+        /// </summary>
153
+        /// <param name="sender"></param>
154
+        /// <param name="e"></param>
155
+        private void Stack()
156
+        {
157
+            _state = State.Start;
158
+        }
159
+        /// <summary>
160
+        /// 暂停
161
+        /// </summary>
162
+        private void TimeOut()
163
+        {
164
+            _state = State.Pause;
165
+        }
166
+        /// <summary>
167
+        /// 结束
168
+        /// </summary>
169
+        /// <param name="sender"></param>
170
+        /// <param name="e"></param>
171
+        private void End()
172
+        {
173
+            _state = State.End;
174
+        }
175
+        /// <summary>
176
+        /// 时钟回调
177
+        /// </summary>
178
+        /// <param name="sender"></param>
179
+        /// <param name="e"></param>
180
+        private void OnTimer(object sender, EventArgs e)
181
+        {
182
+            switch (_state)
183
+            {
184
+                case State.Start:
185
+                    {
186
+                        _timeSpan += new TimeSpan(0, 0, 0, 1);
187
+                    }
188
+                    break;
189
+
190
+                case State.Pause:
191
+                    {
192
+                    }
193
+                    break;
194
+
195
+                case State.End:
196
+                    {
197
+                        _timeSpan = new TimeSpan();
198
+                        //_timeSpan = new TimeSpan(0, 23, 12, 45, 54);
199
+                    }
200
+                    break;
201
+            }
202
+
203
+            string time = string.Format("{0:D2}:{1:D2}",/* _timeSpan.Hours,*/ _timeSpan.Minutes, _timeSpan.Seconds);
204
+            //txbTime.Text = time;
129 205
         }
130 206
         /// <summary>
131 207
         /// 修改布局
@@ -351,7 +427,6 @@ namespace XHWK.WKTool
351 427
             }))).Start();
352 428
 
353 429
         }
354
-
355 430
         /// <summary>
356 431
         /// 上传事件
357 432
         /// </summary>
@@ -448,6 +523,9 @@ namespace XHWK.WKTool
448 523
             //}
449 524
             #endregion
450 525
 
526
+            ImgRecord.Visibility = Visibility.Visible;//设置结束时可录制
527
+            ImgRecordTwo.Visibility = Visibility.Collapsed;//设置结束时可录制
528
+            BtnRecord.IsEnabled = true;//设置结束时可录制
451 529
             if (rbnMP4.IsChecked == true)
452 530
             {
453 531
                 //存储文件
@@ -506,6 +584,9 @@ namespace XHWK.WKTool
506 584
                 GridMain.Visibility = Visibility.Collapsed;
507 585
                 gridSetUp.Visibility = Visibility.Visible;
508 586
                 txbStoragePath.Content = APP.WKData.WkPath;
587
+                ImgRecord.Visibility = Visibility.Collapsed;//设置时不可录制
588
+                ImgRecordTwo.Visibility = Visibility.Visible;//设置时不可录制
589
+                BtnRecord.IsEnabled = false;//设置时不可录制
509 590
                 ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
510 591
                 if ("1".Equals(APP.CameraPosition))
511 592
                 {
@@ -579,14 +660,14 @@ namespace XHWK.WKTool
579 660
             Color = Colors.Red;
580 661
         }
581 662
         /// <summary>
582
-        /// 画笔颜色事件 
663
+        /// 画笔颜色事件 
583 664
         /// </summary>
584 665
         /// <param name="sender"></param>
585 666
         /// <param name="e"></param>
586 667
         private void BtnGray_Click(object sender, RoutedEventArgs e)
587 668
         {
588
-            drawingAttributes.Color = Colors.Gray;
589
-            Color = Colors.Gray;
669
+            drawingAttributes.Color = Colors.Black;
670
+            Color = Colors.Black;
590 671
         }
591 672
         /// <summary>
592 673
         /// 画笔颜色事件 青色
@@ -701,8 +782,11 @@ namespace XHWK.WKTool
701 782
         {
702 783
             string time = GetTimeStamp();
703 784
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
704
-            ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath);
705
-
785
+            ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath,false,out BitmapImage bitmap);
786
+            if (this.WindowState == WindowState.Normal)//截图隐藏窗口
787
+            {
788
+                this.WindowState = WindowState.Minimized;
789
+            }
706 790
             if (APP.W_JieTuWindow != null)
707 791
             {
708 792
                 APP.W_JieTuWindow.initialization();
@@ -729,12 +813,17 @@ namespace XHWK.WKTool
729 813
         {
730 814
             if ("关闭窗口".Equals(text))
731 815
             {
816
+                if (this.WindowState == WindowState.Minimized)//截图完恢复窗口
817
+                {
818
+                    this.WindowState = WindowState.Normal;
819
+                }
732 820
                 if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
733 821
                 {
734 822
                     if (APP.pageData.currpage == 0)
735 823
                     {
736 824
                         APP.pageData.pagenum += 1;
737 825
                         APP.pageData.currpage = APP.pageData.pagenum;
826
+                        gridPage.Visibility = Visibility.Visible;//页码大于0 显示
738 827
                     }
739 828
                     if (APP.PageDrawList.Count >= APP.pageData.currpage)
740 829
                     {
@@ -748,18 +837,10 @@ namespace XHWK.WKTool
748 837
                         model_DrawData.PdfImagePath = APP.ImgPath;
749 838
                         APP.PageDrawList.Add(model_DrawData);
750 839
                     }
751
-                    //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
752
-                    //{
753
-                    //    //imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
754
-                    //    imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage-1].PageImagePath));
755
-                    //}
756 840
                     if (APP.PageDrawList.Count >= APP.pageData.currpage && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
757 841
                     {
758
-                        //imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
759 842
                         imgDocumentation.Source = null;
760 843
                         imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
761
-                        //btnOk.Visibility = Visibility.Visible;
762
-                        //blackboard_canvas.Visibility = Visibility.Collapsed;
763 844
                         APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation = false;
764 845
                         ImgPrint.Visibility = Visibility.Visible;//截图成功可打印
765 846
                         ImgPrintTwo.Visibility = Visibility.Collapsed;
@@ -773,6 +854,10 @@ namespace XHWK.WKTool
773 854
         /// </summary>
774 855
         private void JietuWindow_click_closeJietuWindowClick()
775 856
         {
857
+            if (this.WindowState == WindowState.Minimized)//截图完恢复窗口
858
+            {
859
+                this.WindowState = WindowState.Normal;
860
+            }
776 861
             APP.W_JieTuWindow = null;
777 862
         }
778 863
         /// <summary>
@@ -832,6 +917,8 @@ namespace XHWK.WKTool
832 917
             {
833 918
                 if (ofd.FileName != "")
834 919
                 {
920
+                    APP.myloading.Show();
921
+
835 922
                     #region PPT转PDF
836 923
                     string filepath = ofd.FileName;
837 924
                     string path = ofd.SafeFileName.Replace(".ppt", "").Trim();
@@ -913,6 +1000,7 @@ namespace XHWK.WKTool
913 1000
                             {
914 1001
                                 APP.pageData.currpage = APP.pageData.pagenum + 1;
915 1002
                                 APP.pageData.pagenum += num;
1003
+                                gridPage.Visibility = Visibility.Visible;//页码大于0 显示
916 1004
                             }
917 1005
                             if (APP.pageData.currpage > 0 && APP.pageData.currpage < APP.PageDrawList.Count)
918 1006
                             {
@@ -931,9 +1019,11 @@ namespace XHWK.WKTool
931 1019
                                 ImgScreenshotTwo.Visibility = Visibility.Collapsed;
932 1020
                                 btnScreenshot.IsEnabled = true;
933 1021
                             }
1022
+                            APP.myloading.Hide();
934 1023
                         }
935 1024
                         catch (Exception ex)
936 1025
                         {
1026
+                            APP.myloading.Hide();
937 1027
                             LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(OpenDialog PPT)" + ex.Message, ex);
938 1028
                         }
939 1029
                     }
@@ -991,9 +1081,11 @@ namespace XHWK.WKTool
991 1081
                                 ImgScreenshotTwo.Visibility = Visibility.Collapsed;
992 1082
                                 btnScreenshot.IsEnabled = true;
993 1083
                             }
1084
+                            APP.myloading.Hide();
994 1085
                         }
995 1086
                         catch (Exception ex)
996 1087
                         {
1088
+                            APP.myloading.Hide();
997 1089
                             LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(OpenDialog 导入文档)" + ex.Message, ex);
998 1090
                         }
999 1091
                     }
@@ -1064,6 +1156,8 @@ namespace XHWK.WKTool
1064 1156
                 System.Windows.MessageBox.Show("请先导入文档或截图!");
1065 1157
                 return;
1066 1158
             }
1159
+
1160
+            //btnStop.IsEnabled = true;//停止录制按钮可点击
1067 1161
             StartRecord();
1068 1162
         }
1069 1163
         /// <summary>
@@ -1093,6 +1187,19 @@ namespace XHWK.WKTool
1093 1187
             {
1094 1188
                 if (IsFirstR)//是否第一次录制  初始化录制
1095 1189
                 {
1190
+                    #region 计时器初始化
1191
+                    if (t == null)
1192
+                    {
1193
+                        t = new DispatcherTimer();
1194
+                        t.Tick += OnTimer;
1195
+                        t.Interval = new TimeSpan(0, 0, 0, 1);
1196
+                        t.IsEnabled = true;
1197
+                        t.Start();
1198
+                    }
1199
+                    t.Interval = new TimeSpan(0, 0, 0, 1);
1200
+                    Stack(); 
1201
+                    #endregion
1202
+
1096 1203
                     VideoInfo = new Model_Video();
1097 1204
                     VideoInfo.VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"));
1098 1205
                     VideoInfo.WkType = Enum_WKVidetype.RecordingLessons;
@@ -1162,7 +1269,19 @@ namespace XHWK.WKTool
1162 1269
 
1163 1270
                     btnLoginType.IsEnabled = false;
1164 1271
                     #endregion
1165
-
1272
+                    #region 录像倒计时
1273
+                    if (APP.W_CountdownWindow == null)
1274
+                    {
1275
+                        APP.W_CountdownWindow = new CountdownWindow();
1276
+                        //APP.W_CountdownWindow.Topmost = true;
1277
+                    }
1278
+                    else
1279
+                    {
1280
+                        APP.W_CountdownWindow.Initialize();
1281
+                        //APP.W_CountdownWindow.Topmost = true;
1282
+                    }
1283
+                    APP.W_CountdownWindow.Show();
1284
+                    #endregion
1166 1285
                     IsFirstR = false;
1167 1286
                     RsImgName = new List<string>();
1168 1287
                     timer = new System.Timers.Timer(200);//设置执行一次(false)还是一直执行(true)
@@ -1170,19 +1289,7 @@ namespace XHWK.WKTool
1170 1289
                     timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
1171 1290
                     timer.Enabled = true; //启动计时器
1172 1291
                 }
1173
-                #region 录像倒计时
1174
-                if (APP.W_CountdownWindow == null)
1175
-                {
1176
-                    APP.W_CountdownWindow = new CountdownWindow();
1177
-                    //APP.W_CountdownWindow.Topmost = true;
1178
-                }
1179
-                else
1180
-                {
1181
-                    APP.W_CountdownWindow.Initialize();
1182
-                    //APP.W_CountdownWindow.Topmost = true;
1183
-                }
1184
-                APP.W_CountdownWindow.Show();
1185
-                #endregion
1292
+            
1186 1293
                 //继续录制
1187 1294
                 IsSuspendR = false;
1188 1295
                 //BtnRecording.Content = "暂停录制";
@@ -1323,13 +1430,17 @@ namespace XHWK.WKTool
1323 1430
                 btnSetUp.IsEnabled = true;
1324 1431
 
1325 1432
                 btnLoginType.IsEnabled = true;
1433
+
1434
+
1435
+                //btnStop.IsEnabled = false;//停止录制按钮不可点击
1436
+
1326 1437
                 #endregion
1327 1438
 
1328 1439
                 IsSuspendR = true;
1329 1440
                 ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
1330 1441
                 ImgStop.Visibility = Visibility.Visible;
1331 1442
                 ImgStopTwo.Visibility = Visibility.Collapsed;
1332
-                TxbRecordingWord.Text = "保存中";
1443
+                txbType.Text = "保存中";
1333 1444
                 #region 2秒内不可点击
1334 1445
                 new Thread(new ThreadStart(new Action(() =>
1335 1446
                 {
@@ -1391,6 +1502,7 @@ namespace XHWK.WKTool
1391 1502
                             BtnRecord.IsEnabled = true;
1392 1503
                             btnStop.IsEnabled = true;
1393 1504
                             TxbRecordingWord.Text = "录制";
1505
+                            txbType.Text = "";
1394 1506
                         });
1395 1507
                         FileToolsCommon.DeleteFile(ThumbnailPathName);
1396 1508
                         VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
@@ -1434,6 +1546,7 @@ namespace XHWK.WKTool
1434 1546
                 blackboard_canvas.Visibility = Visibility.Visible;
1435 1547
             }
1436 1548
             APP.pageData.pagenum += 1;
1549
+            gridPage.Visibility = Visibility.Visible;//页码大于0 显示
1437 1550
             APP.pageData.currpage = APP.pageData.pagenum;
1438 1551
             myblackboard.changepage(APP.pageData.currpage - 1);
1439 1552
             ///清空页面图片UI
@@ -2460,6 +2573,24 @@ namespace XHWK.WKTool
2460 2573
         /// </summary>
2461 2574
         [System.Runtime.InteropServices.DllImport("user32.dll")]
2462 2575
         private static extern int SetCursorPos(int x, int y);
2576
+        /// 截图的图片鼠标右键事件
2577
+        /// </summary>
2578
+        /// <param name="sender"></param>
2579
+        /// <param name="e"></param>
2580
+        private void imgCanvas_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
2581
+        {
2582
+            imgCanvas.Source = null;
2583
+        }
2463 2584
 
2585
+        private void Button_Click(object sender, RoutedEventArgs e)
2586
+        {
2587
+            //System.Windows.SplashScreen(LoadDialog);
2588
+            //Common.system.SplashScreen.Show(typeof(LoadDialog));
2589
+            //Thread.Sleep(5000);
2590
+            //Common.system.SplashScreen.Close();
2591
+            APP.myloading.Show();
2592
+            Thread.Sleep(1000);
2593
+            APP.myloading.Hide();
2594
+        }
2464 2595
     }
2465 2596
 }

+ 10
- 0
XHWK.WKTool/XHWK.WKTool.csproj Ver fichero

@@ -135,6 +135,9 @@
135 135
     <Compile Include="JieTuWindow.xaml.cs">
136 136
       <DependentUpon>JieTuWindow.xaml</DependentUpon>
137 137
     </Compile>
138
+    <Compile Include="LoadDialog.xaml.cs">
139
+      <DependentUpon>LoadDialog.xaml</DependentUpon>
140
+    </Compile>
138 141
     <Compile Include="LoginWindow.xaml.cs">
139 142
       <DependentUpon>LoginWindow.xaml</DependentUpon>
140 143
     </Compile>
@@ -181,6 +184,10 @@
181 184
       <SubType>Designer</SubType>
182 185
       <Generator>MSBuild:Compile</Generator>
183 186
     </Page>
187
+    <Page Include="LoadDialog.xaml">
188
+      <SubType>Designer</SubType>
189
+      <Generator>MSBuild:Compile</Generator>
190
+    </Page>
184 191
     <Page Include="PracticeWindow.xaml">
185 192
       <SubType>Designer</SubType>
186 193
       <Generator>MSBuild:Compile</Generator>
@@ -1515,5 +1522,8 @@
1515 1522
   <ItemGroup>
1516 1523
     <Resource Include="Images\APP.png" />
1517 1524
   </ItemGroup>
1525
+  <ItemGroup>
1526
+    <Resource Include="Images\img_load.gif" />
1527
+  </ItemGroup>
1518 1528
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1519 1529
 </Project>

+ 2
- 2
XHWK.WKTool/ZConfig.cs Ver fichero

@@ -13,9 +13,9 @@ namespace XHWK.WKTool.Config
13 13
         /// <summary>
14 14
         /// 当前版本号
15 15
         /// </summary>
16
-        public static int versionCode = 1;
16
+        public static int versionCode = 2;
17 17
 
18
-        public static string versionName = "1.0.0";
18
+        public static string versionName = "1.0.1";
19 19
 
20 20
         //接口地址
21 21
         public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : "http://schoolapi.xhkjedu.com";

Loading…
Cancelar
Guardar