Closed chen2well closed 8 months ago
update in ScreenCapture 问题已再此提交修复。
<Window>
<Window.Resources>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers;component/Themes/Light.Blue.xaml"/>
<!--需要注意 wd:Resources 必须在配色主题后,Theme="Dark" 为黑色皮肤-->
<wd:Resources Theme="Light"/>
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers;component/Themes/Theme.xaml"/>
</ResourceDictionary.MergedDictionaries>
</Window.Resources>
<Button Content="ScreenCapture" VerticalAlignment="Top" HorizontalAlignment="Center" Click="Button_Click" Margin="0,10"/>
</Window>
private void Button_Click(object sender, RoutedEventArgs e)
{
Dispatcher.Invoke(new Action(delegate
{
ScreenCapture screenCapturer = new ScreenCapture(resources: this.Resources);
screenCapturer.Capture();
}));
}
当加载资源字典无法写在App.xaml时,写在Window.Resources时 ScreenCapture及ScreenCut无法正常使用