dev_ocr_translate
DESKTOP-3BO4HSG\ksat 2 years ago
parent ec121dbb58
commit 1f1ecb1af6

@ -46,17 +46,7 @@
  <AllowedReferenceRelatedFileExtensions>
    <!-- 阻止默认的 XML 和 PDB 文件复制到 RELEASE 的输出目录. 只有*.allowedextension 扩展名的文件可以被包含, 当然这个扩展的文件并不存在.-->
    .allowedextension
  </AllowedReferenceRelatedFileExtensions>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
</PropertyGroup>
  </AllowedReferenceRelatedFileExtensions><PlatformTarget>AnyCPU</PlatformTarget><DebugType>none</DebugType><Optimize>true</Optimize><OutputPath>bin\Release\</OutputPath><DefineConstants>TRACE</DefineConstants><ErrorReport>prompt</ErrorReport><WarningLevel>4</WarningLevel><Prefer32Bit>false</Prefer32Bit><GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies></PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Images\translate.ico</ApplicationIcon>
</PropertyGroup>
@ -109,6 +99,10 @@
</Compile>
<Compile Include="Util\Util.cs" />
<Compile Include="ViewModel\MainVM.cs" />
<Compile Include="ViewModel\ScreenShotVM.cs" />
<Compile Include="View\ScreenShotWindow.xaml.cs">
<DependentUpon>ScreenShotWindow.xaml</DependentUpon>
</Compile>
<Page Include="View\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -153,6 +147,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\ScreenShotWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Model\BaiduModel.cs" />

@ -0,0 +1,45 @@
<Window x:Class="STranslate.View.ScreenShotWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:STranslate.View"
mc:Ignorable="d"
Title="ScreenShotWindow"
Height="1" Width="1"
ShowInTaskbar="False"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
Topmost="True"
Cursor="Cross"
Background="Transparent"
WindowStyle="None"
ResizeMode="NoResize"
IsTabStop="False">
<Window.InputBindings>
<KeyBinding Key="Esc"
Command="{Binding EscCmd}"/>
</Window.InputBindings>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseRightButtonDown">
<i:InvokeCommandAction Command="{Binding EscCmd}"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseMove">
<i:InvokeCommandAction Command="{Binding MouseMoveCmd}"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeftButtonDown">
<i:InvokeCommandAction Command="{Binding MouseLeftDownCmd}"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding MouseLeftUpCmd}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<Canvas x:Name="ScreenCanvas">
<Rectangle x:Name="LeftMask" Fill="#111410" Opacity="0.6" />
<Rectangle x:Name="RightMask" Fill="#111410" Opacity="0.6" />
<Rectangle x:Name="UpMask" Fill="#111410" Opacity="0.6" />
<Rectangle x:Name="DownMask" Fill="#111410" Opacity="0.6" />
</Canvas>
</Window>

@ -0,0 +1,30 @@
using STranslate.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace STranslate.View
{
/// <summary>
/// ScreenShotWindow.xaml 的交互逻辑
/// </summary>
public partial class ScreenShotWindow : Window
{
public ScreenShotWindow()
{
InitializeComponent();
DataContext = new ScreenShotVM(this);
}
}
}

@ -223,7 +223,10 @@ namespace STranslate.ViewModel
/// </summary>
public void ScreenShotTranslate()
{
MessageBox.Show("aaa");
//MessageBox.Show("aaa");
var xx = new ScreenShotWindow();
xx.Show();
xx.Activate();
}
/// <summary>

@ -0,0 +1,32 @@
using STranslate.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
namespace STranslate.ViewModel
{
public class ScreenShotVM : BaseVM
{
public ScreenShotVM(Window ui)
{
_ScreenShotWin = ui;
EscCmd = new RelayCommand((_) => true, (_) =>
{
_ScreenShotWin.Close();
});
}
public ICommand EscCmd { get; private set; }
public ICommand MouseMoveCmd { get; private set; }
public ICommand MouseLeftDownCmd { get; private set; }
public ICommand MouseLeftUpCmd { get; private set; }
private Window _ScreenShotWin;
}
}
Loading…
Cancel
Save