Browse Source

自适应

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
251c6cafa8

+ 3
- 2
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs View File

131
             #endregion
131
             #endregion
132
             if (APP.W_XHMicroLessonSystemWindow == null)
132
             if (APP.W_XHMicroLessonSystemWindow == null)
133
             {
133
             {
134
+                //double proportion = 1036.0 / 1276.0;
134
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
135
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
135
-                APP.W_XHMicroLessonSystemWindow.Width =1036;
136
-                APP.W_XHMicroLessonSystemWindow.Height =1276;
136
+                //APP.W_XHMicroLessonSystemWindow.Width = proportion * (PrimaryScreen.ScaleScreenSize().Height-40);
137
+                //APP.W_XHMicroLessonSystemWindow.Height =/*1276-*/ PrimaryScreen.ScaleScreenSize().Height-40;
137
                 //APP.W_XHMicroLessonSystemWindow .Topmost = true;
138
                 //APP.W_XHMicroLessonSystemWindow .Topmost = true;
138
             }
139
             }
139
             APP.W_XHMicroLessonSystemWindow.Show();
140
             APP.W_XHMicroLessonSystemWindow.Show();

+ 13
- 11
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

9
         xmlns:local="clr-namespace:XHWK.WKTool"
9
         xmlns:local="clr-namespace:XHWK.WKTool"
10
         mc:Ignorable="d"
10
         mc:Ignorable="d"
11
         Title="星火微课系统" Height="1036" Width="1276" 
11
         Title="星火微课系统" Height="1036" Width="1276" 
12
-    WindowStyle="None"    AllowsTransparency="True"  Background="Transparent"    ShowInTaskbar="True" ResizeMode="CanMinimize" BorderThickness="7">
12
+    WindowStyle="None"  WindowStartupLocation="CenterScreen"  AllowsTransparency="True"  Background="Transparent"    ShowInTaskbar="True" ResizeMode="CanMinimize" BorderThickness="7">
13
     <Window.Effect>
13
     <Window.Effect>
14
         <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
14
         <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
15
     </Window.Effect>
15
     </Window.Effect>
139
         </RadialGradientBrush>
139
         </RadialGradientBrush>
140
     </Window.BorderBrush>
140
     </Window.BorderBrush>
141
 
141
 
142
-    <Viewbox>
143
-        <Canvas Height="1036" Width="1276">
144
-
145
-
146
-            <Grid x:Name="GridContent" Height="1036" Width="1276">
142
+    <Viewbox Stretch="Fill">
143
+        <Grid x:Name="GridContent" Height="1036" Width="1276" >
147
 
144
 
148
             <!--分3行-->
145
             <!--分3行-->
149
             <Grid.RowDefinitions>
146
             <Grid.RowDefinitions>
150
-                <RowDefinition Height="10*"/>
147
+                <RowDefinition Height="10.2*"/>
151
                 <RowDefinition Height="86*"/>
148
                 <RowDefinition Height="86*"/>
152
-                <RowDefinition Height="3.5*"/>
149
+                <RowDefinition Height="3.8*"/>
153
             </Grid.RowDefinitions>
150
             </Grid.RowDefinitions>
154
             <Grid Grid.Row="0" Background="#2D8CF0" MouseLeftButtonDown="Window_MouseLeftButtonDown" Margin="0,0,0,0">
151
             <Grid Grid.Row="0" Background="#2D8CF0" MouseLeftButtonDown="Window_MouseLeftButtonDown" Margin="0,0,0,0">
155
                 <Grid.RowDefinitions>
152
                 <Grid.RowDefinitions>
157
                     <RowDefinition Height="auto"/>
154
                     <RowDefinition Height="auto"/>
158
                 </Grid.RowDefinitions>
155
                 </Grid.RowDefinitions>
159
                 <!--第一行-->
156
                 <!--第一行-->
157
+                <StackPanel Orientation="Horizontal" Grid.Row="0" x:Name="splOne">
160
                 <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10,2,10,0">
158
                 <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10,2,10,0">
161
                     <Image Source="./Images/microLessonSystem_0.png"/>
159
                     <Image Source="./Images/microLessonSystem_0.png"/>
162
                     <TextBlock Text="星火微课系统" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
160
                     <TextBlock Text="星火微课系统" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
163
                 </StackPanel>
161
                 </StackPanel>
162
+
164
                 <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,2,10,0">
163
                 <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,2,10,0">
165
                     <Button Cursor="Hand" x:Name="btnLoginType" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnLoginType_Click">
164
                     <Button Cursor="Hand" x:Name="btnLoginType" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,10,0" Click="BtnLoginType_Click">
166
                         <StackPanel Orientation="Horizontal">
165
                         <StackPanel Orientation="Horizontal">
178
                         <Image Source="./Images/microLessonSystem_10.png"/>
177
                         <Image Source="./Images/microLessonSystem_10.png"/>
179
                     </Button>
178
                     </Button>
180
                 </StackPanel>
179
                 </StackPanel>
180
+                </StackPanel>
181
+
181
                 <!--第二行-->
182
                 <!--第二行-->
183
+                <StackPanel Grid.Row="1" x:Name="splTwo" Orientation="Horizontal">
182
                 <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,6,0,0">
184
                 <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,6,0,0">
183
                     <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click" Margin="30,0,0,0">
185
                     <Button Cursor="Hand" x:Name="btnScreenRecording" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnScreenRecording_Click" Margin="30,0,0,0">
184
                         <StackPanel Orientation="Vertical">
186
                         <StackPanel Orientation="Vertical">
255
                         </StackPanel>
257
                         </StackPanel>
256
                     </Button>
258
                     </Button>
257
                 </StackPanel>
259
                 </StackPanel>
260
+                </StackPanel>
258
             </Grid>
261
             </Grid>
259
             <!--主内容-->
262
             <!--主内容-->
260
             <Grid Grid.Row="1" x:Name="GridMain" Width="1276" Visibility="Visible">
263
             <Grid Grid.Row="1" x:Name="GridMain" Width="1276" Visibility="Visible">
578
                     <TextBlock x:Name="txbNotConnected" Text="未连接" FontSize="14" Padding="0,5,5,0"/>
581
                     <TextBlock x:Name="txbNotConnected" Text="未连接" FontSize="14" Padding="0,5,5,0"/>
579
                 </StackPanel>
582
                 </StackPanel>
580
             </Grid>
583
             </Grid>
581
-                <Button Content="Button" HorizontalAlignment="Left" Margin="584,40,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
582
-            </Grid>
583
-        </Canvas>
584
+            <Button Content="Button" HorizontalAlignment="Left" Margin="584,40,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
585
+        </Grid>
584
     </Viewbox>
586
     </Viewbox>
585
 </Window>
587
 </Window>

+ 15
- 3
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

109
         {
109
         {
110
             new Aspose.Pdf.License().SetLicense(new MemoryStream(Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICA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aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+M2U0NGRlMzAtZmNkMi00MTA2LWIzNWQtNDZjNmEzNzE1ZmMyPC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjAwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT53UGJtNUt3ZTYvRFZXWFNIY1o4d2FiVEFQQXlSR0pEOGI3L00zVkV4YWZpQnd5U2h3YWtrNGI5N2c2eGtnTjhtbUFGY3J0c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=")));
111
             InitializeComponent();
111
             InitializeComponent();
112
-       
112
+            double proportion = 1036.0 / 1276.0;
113
+            Width = proportion * (PrimaryScreen.ScaleScreenSize().Height - 40);
114
+            Height =/*1276-*/ PrimaryScreen.ScaleScreenSize().Height - 40;
115
+            GridContent.Width = Width;
116
+            GridContent.Height = Width;
113
 
117
 
114
-            this.Top = (screeHeight - this.Height) / 2;
115
 
118
 
116
-            this.Left = (screeWidth - this.Width) / 2;
119
+            double splProportion = 1036.0 / 1276.0;
120
+
121
+            splOne.Height = 20;
122
+            splTwo.Height = 40;
123
+
124
+            //GridMain.Height= PrimaryScreen.ScaleScreenSize().Height - 40;
125
+
126
+            //this.Top = (screeHeight - this.Height) / 2;
127
+
128
+            //this.Left = (screeWidth - this.Width) / 2;
117
             this.ResizeMode = System.Windows.ResizeMode.CanMinimize;
129
             this.ResizeMode = System.Windows.ResizeMode.CanMinimize;
118
             btnPrint.IsEnabled = false;
130
             btnPrint.IsEnabled = false;
119
 
131
 

Loading…
Cancel
Save