IRONSOFTWAREHOME
동영상

DevExpress Barcode에서 IronBarcode로 마이그레이션

Curtis Chau
Curtis Chau
Updated: 2026년 6월 20일

DevExpress의 그리드, 차트, 스케줄러 또는 피벗 컨트롤을 사용하고 있다면 해당 컨트롤은 그대로 유지하십시오. 이 마이그레이션은 BarCodeControl를 바코드를 읽고, 헤드리스로 실행하며, UI 컨텍스트 외부에 배포할 수 있는 라이브러리로 교체하는 것을 다룹니다. WinForms 또는 Blazor 애플리케이션에 사용하는 DevExpress UI 컨트롤은 이번 마이그레이션에서 변경되지 않습니다. 바코드 관련 코드만 변경됩니다.

이러한 마이그레이션을 유발하는 일반적인 시나리오는 다음 세 가지 중 하나입니다. 읽기 요구 사항이 발생했는데 DevExpress가 이를 충족할 수 없는 경우, 새로운 서비스에서 WinForms 어셈블리가 없는 ASP.NET Core 또는 클라우드 함수를 사용하여 바코드를 생성해야 합니다. 혹은 Suite 갱신 시기가 되면 바코드 출력만을 위한 전체 UI 툴킷 사용에 대한 기능별 비용 계산이 더 이상 타당하지 않게 됩니다.

1단계: IronBarcode 설치

dotnet add package BarCode

같은 프로젝트에 다른 DevExpress 컨트롤을 유지하는 경우 DevExpress NuGet 패키지를 그대로 두십시오. 소스 파일에서 바코드 관련 코드만 변경됩니다. 만약 바코드 생성이 특정 프로젝트에 DevExpress가 포함된 유일한 이유이고 해당 프로젝트에서 다른 DX 컨트롤을 전혀 사용하지 않는다면, 마이그레이션 후 해당 프로젝트에서 DevExpress 패키지를 제거할 수 있습니다.

# Only remove DevExpress packages if no other DX controls are used in this project
dotnet remove package DevExpress.Win.Navigation
SHELL

2단계: 라이선스 초기화 추가

애플리케이션 시작 시 한 번 IronBarcode 라이선스를 활성화하세요 - Program.cs, App.xaml.cs 또는 호스트 빌더에서:

// In Program.cs (ASP.NET Core) or application entry point
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

네트워크 통화가 아닙니다. 확인할 오류 코드가 없습니다. 로컬 유효성 검사.

3단계: 바코드별 코드 교체

코드베이스에서 DevExpress 바코드 유형을 검색하세요. 나머지는 그대로 유지됩니다.

# Find barcode-related DevExpress usage — ignore grid, chart, and other DX components
grep -r "BarCodeControl\|Code128Generator\|QRCodeGenerator\|DataMatrixGenerator\|PDF417Generator\|AztecCodeGenerator\|DevExpress.XtraPrinting.BarCode" --include="*.cs" .
grep -r "barCode\.Module\|DrawToBitmap\|BarCode\.Symbology" --include="*.cs" .
SHELL

이 검색 결과는 교체할 부품과 정확히 일치합니다. 그 외에는 아무것도 없습니다.

코드 마이그레이션 예제

코드 128 생성

이것이 가장 흔한 마이그레이션 방식입니다. BarCodeControl은(는) Code128Generator 심볼로지와 함께 단일 BarcodeWriter.CreateBarcode 호출이 됩니다.

이전 — DevExpress WinForms 컨트롤:

using DevExpress.XtraEditors;
using DevExpress.XtraPrinting.BarCode;
using System.Drawing;
using System.Drawing.Imaging;

public void GenerateCode128(string data, string outputPath)
{
    var barCode = new BarCodeControl();
    var symbology = new Code128Generator();
    symbology.CharacterSet = Code128CharacterSet.CharsetAuto;
    barCode.Symbology = symbology;
    barCode.Text = data;
    barCode.Module = 0.02f;
    barCode.ShowText = true;

    barCode.Width = 400;
    barCode.Height = 100;
    var bitmap = new Bitmap(barCode.Width, barCode.Height);
    barCode.DrawToBitmap(bitmap, new Rectangle(0, 0, barCode.Width, barCode.Height));
    bitmap.Save(outputPath, ImageFormat.Png);
    bitmap.Dispose();
}

이후 — IronBarcode:

// NuGet: dotnet add package BarCode
using IronBarCode;

public void GenerateCode128(string data, string outputPath)
{
    BarcodeWriter.CreateBarcode(data, BarcodeEncoding.Code128)
        .ResizeTo(400, 100)
        .SaveAsPng(outputPath);
}

barCode.Module = 0.02f 문서-단위 크기 조정이 사라졌습니다. .ResizeTo(400, 100)은(는) 픽셀을 직접 받습니다. 수동 Bitmap 할당 및 DrawToBitmap 호출이 .SaveAsPng()로 대체되어 크기 조정을 자동으로 처리합니다.

QR 코드 생성

이전 — 오류 수정 기능이 있는 DevExpress QR 코드:

using DevExpress.XtraEditors;
using DevExpress.XtraPrinting.BarCode;
using System.Drawing;
using System.Drawing.Imaging;

public void GenerateQrCode(string url, string outputPath)
{
    var barCode = new BarCodeControl();
    var symbology = new QRCodeGenerator();
    symbology.ErrorCorrectionLevel = QRCodeErrorCorrectionLevel.H;
    symbology.CompactionMode = QRCodeCompactionMode.AlphaNumeric;
    barCode.Symbology = symbology;
    barCode.Text = url;

    barCode.Width = 500;
    barCode.Height = 500;
    var bitmap = new Bitmap(barCode.Width, barCode.Height);
    barCode.DrawToBitmap(bitmap, new Rectangle(0, 0, barCode.Width, barCode.Height));
    bitmap.Save(outputPath, ImageFormat.Png);
    bitmap.Dispose();
}

이후 — IronBarcode:

using IronBarCode;

public void GenerateQrCode(string url, string outputPath)
{
    QRCodeWriter.CreateQrCode(url, 500, QRCodeWriter.QrErrorCorrectionLevel.Highest)
        .SaveAsPng(outputPath);
}

QRCodeErrorCorrectionLevel.H은(는) QRCodeWriter.QrErrorCorrectionLevel.Highest로 매핑됩니다. CompactionMode.AlphaNumeric 설정은 IronBarcode가 콘텐츠에 따라 자동으로 처리합니다.

브랜드 로고가 포함된 QR 코드 (새로운 기능 - DevExpress에서는 불가능):

using IronBarCode;

public void GenerateBrandedQrCode(string url, string logoPath, string outputPath)
{
    QRCodeWriter.CreateQrCode(url, 500, QRCodeWriter.QrErrorCorrectionLevel.Highest)
        .AddBrandLogo(logoPath)
        .SaveAsPng(outputPath);
}

데이터 행렬 생성

이전 — DevExpress:

using DevExpress.XtraEditors;
using DevExpress.XtraPrinting.BarCode;

var barCode = new BarCodeControl();
var symbology = new DataMatrixGenerator();
symbology.MatrixSize = DataMatrixSize.Matrix26x26;
barCode.Symbology = symbology;
barCode.Text = "PART-7734-X";
// ... DrawToBitmap pattern

이후 — IronBarcode:

using IronBarCode;

BarcodeWriter.CreateBarcode("PART-7734-X", BarcodeEncoding.DataMatrix)
    .ResizeTo(260, 260)
    .SaveAsPng("datamatrix.png");

PDF417 세대

이전 — DevExpress:

using DevExpress.XtraEditors;
using DevExpress.XtraPrinting.BarCode;

var barCode = new BarCodeControl();
barCode.Symbology = new PDF417Generator();
barCode.Text = "SHIPMENT-DATA-2026";
// ... DrawToBitmap pattern

이후 — IronBarcode:

using IronBarCode;

BarcodeWriter.CreateBarcode("SHIPMENT-DATA-2026", BarcodeEncoding.PDF417)
    .ResizeTo(400, 150)
    .SaveAsPng("pdf417.png");

읽기 기능 추가 (새로운 기능)

DevExpress는 읽기 API를 제공하지 않습니다. 판독 요구 사항이 발생한 경우, 바로 이 지점에서 IronBarcode 진가가 발휘됩니다.

using IronBarCode;

// Read from an image file
var results = BarcodeReader.Read("uploaded-label.png");
foreach (var result in results)
{
    Console.WriteLine($"Found {result.Format}: {result.Value}");
}

// Read with options for better accuracy on difficult images
var options = new BarcodeReaderOptions
{
    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = true,
    MaxParallelThreads = 4
};
var detailedResults = BarcodeReader.Read("multi-barcode-sheet.png", options);

ASP.NET Core 바코드 엔드포인트

이는 BarCodeControl와(과) WinForms 우회 방법 없이는 달성할 수 없었습니다. IronBarcode 이를 기본적으로 지원합니다.

using IronBarCode;

// In Program.cs or a controller
app.MapGet("/label/{sku}", (string sku) =>
{
    var pngBytes = BarcodeWriter.CreateBarcode(sku, BarcodeEncoding.Code128)
        .ResizeTo(400, 100)
        .ToPngBinaryData();

    return Results.File(pngBytes, "image/png", $"{sku}.png");
});

app.MapGet("/qr/{data}", (string data) =>
{
    var pngBytes = QRCodeWriter.CreateQrCode(data, 300, QRCodeWriter.QrErrorCorrectionLevel.Highest)
        .ToPngBinaryData();

    return Results.File(pngBytes, "image/png");
});

PDF 파일에서 바코드 읽기

IronBarcode PDF 파일에서 직접 읽기 기능을 제공합니다. PDFiumViewer도, 렌더링 루프도, 추가 패키지도 필요 없습니다.

using IronBarCode;

// Read all barcodes from all pages of a PDF
var results = BarcodeReader.Read("shipping-manifest.pdf");
foreach (var result in results)
{
    Console.WriteLine($"Barcode: {result.Value} | Format: {result.Format}");
}

일반적인 마이그레이션 문제

barCode.Module은 픽셀 단위가 아닌 문서 단위를 사용합니다.

barCode.Module은(는) 문서 단위에서 가장 좁은 바의 폭을 제어합니다 (렌더링 DPI 컨텍스트에 따라 다릅니다). 이것은 픽셀 수가 아닙니다. 이동 시 모듈 값을 픽셀로 변환하지 말고 원하는 픽셀 크기를 결정하고 .ResizeTo(width, height)을 직접 사용하세요.

// Before: barCode.Module = 0.02f  — document units, indirect sizing
// After:
.ResizeTo(400, 100)  // explicit pixel dimensions

DrawToBitmap 함수는 미리 할당된 비트맵을 필요로 합니다.

이전 패턴에서는 특정 크기의 Bitmap을(를) 할당하고, 그 안에 렌더링하기 위해 DrawToBitmap을(를) 호출했습니다. IronBarcode의 .SaveAsPng()은(는) 이를 내부적으로 모두 처리합니다. 사전에 아무것도 할당하지 않습니다.

// Before: must know size upfront, allocate, draw, save, dispose
barCode.Width = 400;
barCode.Height = 100;
var bitmap = new Bitmap(barCode.Width, barCode.Height);
barCode.DrawToBitmap(bitmap, new Rectangle(0, 0, barCode.Width, barCode.Height));
bitmap.Save(path, ImageFormat.Png);
bitmap.Dispose();

// After: size specified once, everything else handled
BarcodeWriter.CreateBarcode(data, BarcodeEncoding.Code128)
    .ResizeTo(400, 100)
    .SaveAsPng(path);

WinForms 데이터 바인딩

BarCodeControl이(가) WinForms 디자이너에서 데이터 소스에 바인딩된 경우, IronBarcode 등가는 모델에서 값을 명시적으로 읽어 BarcodeWriter.CreateBarcode에 전달하는 것입니다. IronBarcode WinForms 데이터 바인딩을 지원하지 않습니다. 이는 UI 컨트롤이 아니라 프로그래밍 방식의 API입니다. 생성된 바코드를 폼에 표시해야 한다면, 이미지 바이트를 생성하여 이를 PictureBox에 설정하세요:

using IronBarCode;

// Generate and display in a WinForms PictureBox
private void UpdateBarcodeDisplay(string value)
{
    var bytes = BarcodeWriter.CreateBarcode(value, BarcodeEncoding.Code128)
        .ResizeTo(400, 100)
        .ToPngBinaryData();

    using var ms = new System.IO.MemoryStream(bytes);
    pictureBox1.Image = System.Drawing.Image.FromStream(ms);
}

네임스페이스 교체

삭제할 기존 가져오기 항목:

// Remove these
using DevExpress.XtraEditors;
using DevExpress.XtraPrinting.BarCode;

추가할 새 항목:

// Add this
using IronBarCode;

API 매핑 참조

DevExpress 바코드IronBarcode 동등품
new BarCodeControl()정적 — 인스턴스 없음
new Code128Generator() + barCode.Symbology = symbologyBarcodeEncoding.Code128 매개변수
new QRCodeGenerator() + QRCodeErrorCorrectionLevel.HQRCodeWriter.CreateQrCode(data, size, QRCodeWriter.QrErrorCorrectionLevel.Highest)
new DataMatrixGenerator() + DataMatrixSize.Matrix26x26BarcodeWriter.CreateBarcode(data, BarcodeEncoding.DataMatrix)
new PDF417Generator()BarcodeWriter.CreateBarcode(data, BarcodeEncoding.PDF417)
new AztecCodeGenerator()BarcodeWriter.CreateBarcode(data, BarcodeEncoding.Aztec)
barCode.Text = valueCreateBarcode 또는 CreateQrCode의 첫 번째 인수
barCode.Module = 0.02f픽셀 단위의 .ResizeTo(width, height)
barCode.ShowText = true.AddBarcodeText()
DrawToBitmap(bitmap, rect).SaveAsPng(path)
new Bitmap(w, h) + 수동 해제필요 없음
비트맵 → MemoryStream → HTTP.ToPngBinaryData()
읽기 API 없음BarcodeReader.Read(path)
using DevExpress.XtraEditors + using DevExpress.XtraPrinting.BarCodeusing IronBarCode

마이그레이션 체크리스트

다음 grep 패턴을 사용하여 업데이트가 필요한 모든 파일을 찾으세요.

grep -r "BarCodeControl\|Code128Generator\|QRCodeGenerator\|DataMatrixGenerator\|PDF417Generator\|AztecCodeGenerator" --include="*.cs" .
grep -r "barCode\.Module\|barCode\.Symbology\|DrawToBitmap\|DevExpress\.XtraPrinting\.BarCode" --include="*.cs" .
SHELL

각 경기를 하나씩 살펴보세요:

  • using DevExpress.XtraEditors;와(과) using DevExpress.XtraPrinting.BarCode;을(를) using IronBarCode;로 교체하세요
  • new BarCodeControl() + 심볼로지 설정을 BarcodeWriter.CreateBarcode(data, BarcodeEncoding.X)로 교체하세요
  • new QRCodeGenerator() + 심볼로지 설정을 QRCodeWriter.CreateQrCode(data, size, errorLevel)로 교체하세요
  • barCode.Module = X을(를) .ResizeTo(width, height)로 교체하세요
  • DrawToBitmap + bitmap.Save 패턴을 .SaveAsPng(path)로 교체하세요
  • 비트맵-메모리스트림 패턴을 .ToPngBinaryData()로 교체하세요
  • 애플리케이션 시작 시 IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"을(를) 추가하세요
  • 읽기 기능이 필요한 곳마다 BarcodeReader.Read() 호출을 추가하세요

프로젝트에서 바코드 컨트롤에만 DevExpress를 사용하고 다른 DX 구성 요소를 사용하지 않는 경우, 모든 바코드 참조를 교체한 후 DevExpress NuGet 패키지를 제거하십시오. 프로젝트에서 DevExpress 그리드, 차트 또는 기타 UI 컨트롤을 사용하는 경우 해당 패키지는 그대로 두십시오. 이 마이그레이션은 바코드 코드만 수정합니다.

Curtis Chau
기술 문서 작성자

커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.

...
더 읽어보기

관련 기사

Key in blue circle

무료 30일 체험 키를 즉시 받으세요.

Your trial license will be sent to your email address

제한 없음. 100% 무제한 이용. 신용카드 불필요.

bullet_checked신용카드나 계정 생성은 필요하지 않습니다.제한 없음. 100% 무제한 이용. 신용카드 불필요.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
무료 라이브 데모를 예약하세요
Booking Badge

전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.

Iron Software의 고객 로고
부담 없는 무료 상담을 받아보세요
아래 양식을 작성하시거나 sales@ironsoftware.com으로 이메일을 보내주세요.
고객님의 정보는 항상 비밀로 유지됩니다.
전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.
Iron Software의 고객 로고
지금 바로 30일 무료 체험판 키를 받으세요.
신용카드나 계정 생성은 필요하지 않습니다.