编程语言
首页 > 编程语言> > c# QRCoder和BarCode插件

c# QRCoder和BarCode插件

作者:互联网

1.Nuget安装插件包

 

 

 2.介绍两个包中最简单的使用方法。

 

 

 

using System;
using System.Collections.Generic;
using System.IO;
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.Navigation;
using System.Windows.Shapes;

namespace WpfApp1
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            
            //1.生成二维码
            QRCoder.QRCodeHelper.GetQRCode("华为mate20", 10, System.Drawing.Color.Black, System.Drawing.Color.White, QRCoder.QRCodeGenerator.ECCLevel.H);

            //2.生成条形码
            IronBarCode.BarcodeWriter.CreateBarcode("mate20", IronBarCode.BarcodeWriterEncoding.Code128).
                SaveAsJpeg($"{Environment.CurrentDirectory}\\1.jpeg");
            
        }
    }
}

  

标签:插件,c#,Media,BarCode,System,QRCoder,Windows,using,MainWindow
来源: https://www.cnblogs.com/zsz-blogs/p/14700438.html