Application/C# (WinForm)
[C# WinForm] QRCode 만들기 (zxing.dll)
devsalix
2023. 8. 2. 16:19
728x90
zxing.dll 파일을 이용해서 간단히 QR 코드 만드는 방법을 포스팅을 해 보겠습니다
우선 dll 파일을 참조합니다
해당 파일을 프로젝트 폴더에 넣으시고
프로젝트 참조에서 zxing.dll 파일을 참조합니다
이후 아래와 같이 코드를 작성하시면 쉽게 QR코드 생성이 가능합니다
using ZXing;
using ZXing.QrCode;
public void MakeQRCode(string strCode, PictureBox picturebox)
{
IBarcodeWriter writer = new BarcodeWriter();
writer.Format = BarcodeFormat.QR_CODE;
writer.Options.Width = picturebox.Width;
writer.Options.Height = picturebox.Height;
picturebox.Image = writer.Write(strCode);
}
코드와 picture 박스 컨트롤을 참조하면 해당 picturebox 컨트롤에 작성한 코드로 QR 코드가 생성됩니다
제 글이 도움이 되셨다면 댓글 & 공감 부탁드려요 😀
728x90
반응형