Skip to content

Commit

Permalink
fix aforge; fix selectedengine
Browse files Browse the repository at this point in the history
  • Loading branch information
1357310795 committed Dec 16, 2023
1 parent 6343b75 commit 1383540
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
3 changes: 0 additions & 3 deletions MyQrCodeScanner/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
ShutdownMode="OnLastWindowClose">
<Application.Resources>
<ResourceDictionary>
<sys:Int32 x:Key="Engine">
1
</sys:Int32>
<ContextMenu x:Key="SysTrayMenu">
<MenuItem Command="{Binding ShowWindowCommand}" Header="{DynamicResource Show}" />
<Separator />
Expand Down
1 change: 0 additions & 1 deletion MyQrCodeScanner/InitWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ public int SelectedEngine
{
GlobalSettings.selectedengine = value;
this.RaisePropertyChanged("SelectedEngine");
Application.Current.Resources["Engine"] = GlobalSettings.selectedengine;
IniHelper.SetKeyValue("main", "engine", GlobalSettings.selectedengine.ToString(), IniHelper.inipath);
}
}
Expand Down
4 changes: 2 additions & 2 deletions MyQrCodeScanner/Modules/MyScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public class MyScanner

public static MyResult ScanCode(Bitmap img)
{
var method = (int)Application.Current.Resources["Engine"];
var method = GlobalSettings.selectedengine;

try
{
Expand All @@ -150,7 +150,7 @@ public static MyResult ScanCode(Bitmap img)

public static MyResult ScanCode(System.Windows.Media.Imaging.BitmapSource img)
{
var method = (int)Application.Current.Resources["Engine"];
var method = GlobalSettings.selectedengine;
try
{
if (method == 1)
Expand Down
4 changes: 3 additions & 1 deletion MyQrCodeScanner/MyQrCodeScanner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AForge" Version="2.2.5" />
<PackageReference Include="AForge.Video" Version="2.2.5" />
<PackageReference Include="AForge.Video.DirectShow" Version="2.2.5" />
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.6" />
<PackageReference Include="Teru.Code.AForge" Version="2.2.5" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
<PackageReference Include="InputSimulatorPlus" Version="1.0.7" />
Expand Down
2 changes: 1 addition & 1 deletion MyQrCodeScanner/Views/PDAWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
Margin="0,0,0,45"
Text="{DynamicResource SelectCameraAndStart}"
FontSize="36" />
<Image x:Name="videoPlayer" />
<Image x:Name="videoPlayer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>
</DockPanel>
</Window>

0 comments on commit 1383540

Please sign in to comment.