C\#제3자 구성 요 소 를 사용 하여 QR 코드 집합 생 성
1.QrCodeNet(Gma.QrCodeNet.Encoding.dll)을 통 해 구현
1.1):먼저 VS 2015 의 NuGet 을 통 해 해당 하 는 제3자 구성 요 소 를 다운로드 합 니 다.아래 그림 과 같 습 니 다.
1.2):QR 코드 를 구체 적 으로 생 성 하 는 방법 은 다음 과 같다.
private void GenerateQRByQrCodeNet()
{
QrEncoder qrEncoder = new QrEncoder(ErrorCorrectionLevel.H);
QrCode qrCode = new QrCode();
qrEncoder.TryEncode("Hello World. This is Eric Sun Testing...", out qrCode);
GraphicsRenderer renderer = new GraphicsRenderer(new FixedModuleSize(5, QuietZoneModules.Two), Brushes.Black, Brushes.White);
using (MemoryStream ms = new MemoryStream())
{
renderer.WriteToStream(qrCode.Matrix, ImageFormat.Png, ms);
Image img = Image.FromStream(ms);
img.Save("E:/csharp-qrcode-net.png");
}
}
더 자세 한 정 보 는 다음 링크 를 참고 하 시기 바 랍 니 다.http://qrcodenet.codeplex.com/
http://stackoverflow.com/questions/7020136/free-c-sharp-qr-code-generator
2.ThoughtWorks.QRcode(ThoughtWorks.QRcode.dll)를 통 해 구현
1.1):먼저 VS 2015 의 NuGet 을 통 해 해당 하 는 제3자 구성 요 소 를 다운로드 합 니 다.아래 그림 과 같 습 니 다.
1.2):QR 코드 를 구체 적 으로 생 성 하 는 방법 은 다음 과 같다.
private void GenerateQRByThoughtWorks()
{
QRCodeEncoder encoder = new QRCodeEncoder();
encoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;// ( :BYTE ,ALPHA_NUMERIC )
encoder.QRCodeScale = 4;// ( )
encoder.QRCodeVersion = 0;// ( : 0 )
encoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M;// 、 ( 4 )
encoder.QRCodeBackgroundColor = Color.Yellow;
encoder.QRCodeForegroundColor = Color.Green;
string qrdata = "Hello ! This is Eric Sun Testing....";
Bitmap bcodeBitmap = encoder.Encode(qrdata.ToString());
bcodeBitmap.Save(@"E:\HelloWorld.png", ImageFormat.Png);
bcodeBitmap.Dispose();
}
3):Spire.BarCode(Spire.BarCode.dll)를 통 해 구현1.1):먼저 VS 2015 의 NuGet 을 통 해 해당 하 는 제3자 구성 요 소 를 다운로드 합 니 다.아래 그림 과 같 습 니 다.
1.2):QR 코드 를 구체 적 으로 생 성 하 는 방법 은 다음 과 같다.
private void GenerateQRBySpire()
{
BarcodeSettings bs = new BarcodeSettings()
{
Data = "This is qr code.",
Type = BarCodeType.QRCode,
TopTextColor = Color.Red,
ShowCheckSumChar = false,
ShowText = false
};
//Generate the barcode based on the this.barCodeControl1
BarCodeGenerator generator = new BarCodeGenerator(bs);
Image barcode = generator.GenerateImage();
//save the barcode as an image
barcode.Save(@"E:\barcode-2d.png");
}
1.3):구체 적 인 바코드 생 성 방법 은 다음 과 같다.
private void GenerateBarCodeBySpire()
{
BarcodeSettings bs = new BarcodeSettings()
{
Data = "This is barcode.",
ShowCheckSumChar = false,
TopTextColor = Color.Red,
ShowTopText = false,
ShowTextOnBottom = true
};
//Generate the barcode based on the this.barCodeControl1
BarCodeGenerator generator = new BarCodeGenerator(bs);
Image barcode = generator.GenerateImage();
//save the barcode as an image
barcode.Save(@"E:\barcode.png");
}
더 자세 한 정 보 는 다음 링크 를 참고 하 시기 바 랍 니 다.http://freebarcode.codeplex.com/
http://www.e-iceblue.com/Knowledgebase/Spire.BarCode/Program-Guide/Programme-Guide-for-Spire.BarCode.html
3.바코드 Lib(바코드 Lib.Barcode.ASP.NET.NET.dll)을 통 해 구현
dll 연결 다운로드 http://www.barcodelib.com/asp_net/
4.1):QR 코드 를 구체 적 으로 생 성 하 는 방법 은 다음 과 같다.
private void GenerateQRByBarcodeLib()
{
QRCode qrbarcode = new QRCode();
qrbarcode.Encoding = QRCodeEncoding.Auto;
qrbarcode.Data = "336699885522 This is Eric Sun Testing.";
qrbarcode.ModuleSize = 10;
qrbarcode.LeftMargin = 8;
qrbarcode.RightMargin = 8;
qrbarcode.TopMargin = 8;
qrbarcode.BottomMargin = 8;
qrbarcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif;
// Save QR Code barcode image into your system
qrbarcode.drawBarcode("E:/csharp-qrcode-lib.gif");
}
4.2):구체 적 인 바코드 생 성 방법 은 다음 과 같다.
private void GenerateLinearByBarcodeLib()
{
Linear barcode = new Linear();
barcode.Type = BarcodeType.CODE128;
barcode.Data = "CODE128";
// other barcode settings.
// save barcode image into your system
barcode.drawBarcode("E:/barcode.png");
}
우리 가 사용 하 는 것 은 시용 판(워 터 마크 가 있 는...)이 고 비용 을 지불 하 는 정품 입 니 다.상세 한 내용 은 다음 과 같은 링크 를 참고 하 시기 바 랍 니 다.http://www.barcodelib.com/asp_net/
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
WebView2를 Visual Studio 2017 Express에서 사용할 수 있을 때까지Evergreen .Net Framework SDK 4.8 VisualStudio2017에서 NuGet을 사용하기 때문에 패키지 관리 방법을 packages.config 대신 PackageReference를 사용해야...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.