ScanViwer.xaml.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace PDF_Office.Views.Scan
  16. {
  17. /// <summary>
  18. /// ScanViwer.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class ScanViwer : UserControl
  21. {
  22. public ScanViwer()
  23. {
  24. InitializeComponent();
  25. }
  26. double scale = 1;
  27. private void Grid_MouseWheel(object sender, MouseWheelEventArgs e)
  28. {
  29. if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
  30. {
  31. if (e.Delta > 0)
  32. {
  33. scale += 0.1;
  34. ImageGrid.Width = 500* scale;
  35. ImageGrid.Height = 500 * scale;
  36. }
  37. else
  38. {
  39. if (scale > 0.2)
  40. {
  41. scale -= 0.2;
  42. }
  43. ImageGrid.Width = 500* scale;
  44. ImageGrid.Height = 500 * scale;
  45. }
  46. }
  47. }
  48. }
  49. }