MainWindow.xaml.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using IronBarCode;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace WpfApp2
  17. {
  18. /// <summary>
  19. /// Логика взаимодействия для MainWindow.xaml
  20. /// </summary>
  21. public partial class MainWindow : Window
  22. {
  23. public MainWindow()
  24. {
  25. InitializeComponent();
  26. QRCode();
  27. }
  28. private static void QRCode()
  29. {
  30. var myBarcode = BarcodeWriter.CreateBarcode("https://yandex.ru/search/?text=%D0%BC%D0%B0%D1%81%D0%BA%D0%B0+%D0%B4%D0%BB%D1%8F+%D1%82%D0%B5%D0%BB%D0%B5%D1%84%D0%BE%D0%BD%D0%B0+%D0%B2+1%D1%81+%D0%BA%D0%BE%D0%BD%D1%84%D0%B8%D0%B3%D1%83%D1%80%D0%B0%D1%86%D0%B8%D1%8F&lr=47&clid=2598007-830&win=622", BarcodeWriterEncoding.QRCode);
  31. myBarcode.SaveAsImage("qr.png");
  32. }
  33. }
  34. }