123456789101112131415161718192021222324252627 |
- using QRCoder;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Interop;
- using System.Windows.Media.Imaging;
- using System.Windows;
- using System.Drawing;
- namespace WpfApp1
- {
- internal class QRClass
- {
- public static BitmapSource QR()
- {
- string text = "http://gogs.ngknn.ru:3000/Alexey/PP_Minin";
- QRCodeGenerator qr = new QRCodeGenerator();
- QRCodeData data = qr.CreateQrCode(text, QRCodeGenerator.ECCLevel.Q);
- QRCode code = new QRCode(data);
- Bitmap bitmap = code.GetGraphic(100);
- BitmapSource bitmapImage = (BitmapSource)Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
- return bitmapImage;
- }
- }
- }
|