Просмотр исходного кода

自适应

tags/录制修改前
zhangxueyang 4 лет назад
Родитель
Сommit
251c6cafa8

+ 3
- 2
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs Просмотреть файл

@@ -131,9 +131,10 @@ namespace XHWK.WKTool
131 131
             #endregion
132 132
             if (APP.W_XHMicroLessonSystemWindow == null)
133 133
             {
134
+                //double proportion = 1036.0 / 1276.0;
134 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 138
                 //APP.W_XHMicroLessonSystemWindow .Topmost = true;
138 139
             }
139 140
             APP.W_XHMicroLessonSystemWindow.Show();

+ 13
- 11
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Просмотреть файл

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

+ 15
- 3
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Просмотреть файл

@@ -109,11 +109,23 @@ namespace XHWK.WKTool
109 109
         {
110 110
             new Aspose.Pdf.License().SetLicense(new MemoryStream(Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+M2U0NGRlMzAtZmNkMi00MTA2LWIzNWQtNDZjNmEzNzE1ZmMyPC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjAwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT53UGJtNUt3ZTYvRFZXWFNIY1o4d2FiVEFQQXlSR0pEOGI3L00zVkV4YWZpQnd5U2h3YWtrNGI5N2c2eGtnTjhtbUFGY3J0c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=")));
111 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 129
             this.ResizeMode = System.Windows.ResizeMode.CanMinimize;
118 130
             btnPrint.IsEnabled = false;
119 131
 

Загрузка…
Отмена
Сохранить