IronBarcode 방법 데스크톱 바코드 애플리케이션 만들기 .NET MAUI와 함께 데스크톱 바코드 애플리케이션(스캐너/생성기)을 만드는 방법 커티스 차우 업데이트됨:12월 10, 2025 다운로드 IronBarcode NuGet 다운로드 DLL 다운로드 무료 체험 시작하기 LLM용 사본 LLM용 사본 LLM용 마크다운 형식으로 페이지를 복사하세요 ChatGPT에서 열기 ChatGPT에 이 페이지에 대해 문의하세요 제미니에서 열기 제미니에게 이 페이지에 대해 문의하세요 Grok에서 열기 Grok에게 이 페이지에 대해 문의하세요 혼란 속에서 열기 Perplexity에게 이 페이지에 대해 문의하세요 공유하다 페이스북에 공유하기 트위터에 공유하기 LinkedIn에 공유하기 URL 복사 이메일로 기사 보내기 This article was translated from English: Does it need improvement? Translated View the article in English 포괄적인 소프트웨어 솔루션을 위해서는 모바일 접근성만 중요한 것이 아닙니다. Windows와 macOS와 같은 데스크톱 운영 체제에 네이티브로 배포할 수 있는 능력도 그만큼 중요합니다. 이 플랫폼 간 접근 방식은 자산 추적 및 관리와 같은 대량 작업을 위해 작업 스테이션의 전체 기능을 활용할 수 있도록 해줍니다. 적절한 데스크톱 지원이 없으면 워크플로우가 중단되거나, 더 나쁜 경우에는 덜 유능한 장치에 강제됩니다. 이것은 특히 사무실 직원이 자기 책상에서 벗어나지 않고 신속하게 코드 배치를 생성하거나 스캔을 확인할 필요가 있는 재고 관리에서 특히 중요합니다. IronBarcode는 이러한 기능을 구현하기 위한 필수 도구를 제공하여 .NET MAUI 애플리케이션이 모든 컴퓨터 환경에서 안정적으로 작동할 수 있도록 합니다. 이 기사에서는 데스크톱 바코드 스캐너 및 데스크톱 바코드 생성기를 구축하기 위해 IronBarcode를 어떻게 통합할 수 있는지를 설명합니다. ## C#에서 .NET MAUI를 사용하여 데스크톱 바코드 앱 생성 방법 .NET MAUI (데스크톱 플랫폼 프레임워크)와 통합할 IronBarcode C# 라이브러리 다운로드 `Read`로 사용자가 제공한 업로드된 바코드를 읽기 바코드 값을 .NET MAUI UI에 표시하기 `CreateBarcode`로 문자열 값을 사용해 바코드 생성 생성된 바코드를 .NET MAUI UI에 표시하고 이미지를 저장 .NET MAUI 데스크톱 애플리케이션 IronBarcode를 .NET MAUI 앱에 통합하는 것은 간단하며, 라이브러리가 기본적으로 데스크톱 플랫폼과 호환되기 때문입니다. 이 예제에서는 IronBarcode를 사용하여 바코드 스캐너와 바코드 생성기를 각각 생성할 것입니다. 먼저 바코드 스캐너를 시작해 봅시다. 바코드 스캐너 인터페이스 XAML .NET MAUI 인터페이스에서는 사용자가 제출 버튼을 통해 바코드 이미지를 업로드할 수 있도록 간단한 인터페이스가 구현되었습니다. 프로젝트 내에서 MainPage.xaml 파일은 아래에 표시된 내용으로 교체되어야 합니다. <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MauiApp1.MainPage" BackgroundColor="{DynamicResource PageBackgroundColor}"> <ScrollView> <VerticalStackLayout Spacing="25" Padding="30" VerticalOptions="Center"> <Label Text="Desktop Barcode Scanner" FontSize="32" HorizontalOptions="Center" /> <Image x:Name="ScannerImage" HeightRequest="300" WidthRequest="400" BackgroundColor="#F0F0F0" Aspect="AspectFit" HorizontalOptions="Center" /> <Button Text="Select Image to Scan" Clicked="OnScanButtonClicked" HorizontalOptions="Center" WidthRequest="200"/> <Label x:Name="ResultLabel" Text="Result will appear here..." FontSize="20" HorizontalOptions="Center" HorizontalTextAlignment="Center" /> </VerticalStackLayout> </ScrollView> </ContentPage> <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MauiApp1.MainPage" BackgroundColor="{DynamicResource PageBackgroundColor}"> <ScrollView> <VerticalStackLayout Spacing="25" Padding="30" VerticalOptions="Center"> <Label Text="Desktop Barcode Scanner" FontSize="32" HorizontalOptions="Center" /> <Image x:Name="ScannerImage" HeightRequest="300" WidthRequest="400" BackgroundColor="#F0F0F0" Aspect="AspectFit" HorizontalOptions="Center" /> <Button Text="Select Image to Scan" Clicked="OnScanButtonClicked" HorizontalOptions="Center" WidthRequest="200"/> <Label x:Name="ResultLabel" Text="Result will appear here..." FontSize="20" HorizontalOptions="Center" HorizontalTextAlignment="Center" /> </VerticalStackLayout> </ScrollView> </ContentPage> XML 데스크톱 바코드 스캐너 논리 CS 다음으로, 사용자가 버튼을 클릭할 때의 논리가 구현됩니다. UI의 스캔 버튼에 OnScanButtonClicked 이벤트 핸들러가 연결되어 있습니다. PickPhotoAsync는 사용자가 업로드할 바코드를 선택할 수 있도록 먼저 사용되며, 그 뒤에 OpenReadAsync를 통해 파일 스트림에 접근합니다. 이미지 데이터는 MemoryStream로 즉시 복사되며 CopyToAsync를 사용합니다. 이를 통해 데이터를 화면에 이미지를 표시하고 Read 메서드로 바코드를 스캔하는 데 동시에 사용할 수 있습니다. 마지막으로, 유효한 바코드가 검출되면 바코드 값이 UI에 표시되고, 그렇지 않으면 이미지에 바코드가 없다는 빨간 메시지가 표시됩니다. 참고해 주세요 응용 프로그램을 테스트하기 전에 라이센스 키를 자신의 것으로 교체하세요. using IronBarCode; namespace MauiApp1 { public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); // Your license key is set here IronBarCode.License.LicenseKey = "YOUR_KEY" } private async void OnScanButtonClicked(object sender, EventArgs e) { try { var fileResult = await MediaPicker.Default.PickPhotoAsync(); if (fileResult != null) { // 1. Copy the file content into a byte array or MemoryStream immediately // This ensures we have the data in memory before the file closes byte[] imageBytes; using (var stream = await fileResult.OpenReadAsync()) using (var memoryStream = new MemoryStream()) { await stream.CopyToAsync(memoryStream); imageBytes = memoryStream.ToArray(); } // 2. Set the Image Source for the UI // We give the UI a FRESH stream from the bytes we just saved ScannerImage.Source = ImageSource.FromStream(() => new MemoryStream(imageBytes)); // 3. Process the Barcode // We give IronBarcode its OWN fresh stream from the same bytes using (var processingStream = new MemoryStream(imageBytes)) { // 4. Read the barcode with Read var results = BarcodeReader.Read(processingStream); // 5. Display barcode results if (results != null && results.Count > 0) { // Successfully found barcode value ResultLabel.Text = $"Success: {results[0].Value}"; ResultLabel.TextColor = Colors.Green; } else { // Image uploaded has no barcode or barcode value is not found ResultLabel.Text = "No barcode detected."; ResultLabel.TextColor = Colors.Red; } } } } catch (Exception ex) { // Display any exception thrown in runtime ResultLabel.Text = $"Error: {ex.Message}"; ResultLabel.TextColor = Colors.Red; } } } } using IronBarCode; namespace MauiApp1 { public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); // Your license key is set here IronBarCode.License.LicenseKey = "YOUR_KEY" } private async void OnScanButtonClicked(object sender, EventArgs e) { try { var fileResult = await MediaPicker.Default.PickPhotoAsync(); if (fileResult != null) { // 1. Copy the file content into a byte array or MemoryStream immediately // This ensures we have the data in memory before the file closes byte[] imageBytes; using (var stream = await fileResult.OpenReadAsync()) using (var memoryStream = new MemoryStream()) { await stream.CopyToAsync(memoryStream); imageBytes = memoryStream.ToArray(); } // 2. Set the Image Source for the UI // We give the UI a FRESH stream from the bytes we just saved ScannerImage.Source = ImageSource.FromStream(() => new MemoryStream(imageBytes)); // 3. Process the Barcode // We give IronBarcode its OWN fresh stream from the same bytes using (var processingStream = new MemoryStream(imageBytes)) { // 4. Read the barcode with Read var results = BarcodeReader.Read(processingStream); // 5. Display barcode results if (results != null && results.Count > 0) { // Successfully found barcode value ResultLabel.Text = $"Success: {results[0].Value}"; ResultLabel.TextColor = Colors.Green; } else { // Image uploaded has no barcode or barcode value is not found ResultLabel.Text = "No barcode detected."; ResultLabel.TextColor = Colors.Red; } } } } catch (Exception ex) { // Display any exception thrown in runtime ResultLabel.Text = $"Error: {ex.Message}"; ResultLabel.TextColor = Colors.Red; } } } } $vbLabelText $csharpLabel 바코드 값이 발견된 출력 보시다시피, 응용 프로그램은 바코드 결과와 업로드된 바코드 이미지를 표시합니다. 바코드 값이 발견되지 않은 출력 보시다시피, 사용자가 바코드가 포함되어 있지 않은 이미지를 업로드하면 '바코드가 발견되지 않았습니다'라는 빨간 메시지가 표시됩니다. 데스크톱 바코드 생성기 다음 부분은 같은 개념을 기반으로 MAUI에 IronBarcode를 통합하여 바코드 생성기를 만드는 것입니다. 바코드 생성기 인터페이스 XAML 생성기 인터페이스를 위한 폼은 텍스트 입력과 드롭다운 메뉴를 통한 바코드 유형 선택을 허용하도록 구현됩니다. 버튼은 생성 및 저장 프로세스를 트리거하고, 결과를 표시할 이미지 뷰도 포함되어 있습니다. MainPage.xaml 파일은 아래에 표시된 내용으로 교체해야 합니다. 전체 1D 바코드 목록을 보려면 여기를, 2D 바코드는 여기를 참조하세요. <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MauiApp1.MainPage" BackgroundColor="{DynamicResource PageBackgroundColor}"> <ScrollView> <VerticalStackLayout Spacing="20" Padding="30" VerticalOptions="Center"> <Label Text="Barcode Generator" FontSize="32" HorizontalOptions="Center" /> <Entry x:Name="BarcodeEntry" Placeholder="Enter value (e.g. 12345 or https://ironsoftware.com)" WidthRequest="300" /> <Picker x:Name="BarcodeTypePicker" Title="Select Barcode Type" WidthRequest="300"> <Picker.ItemsSource> <x:Array Type="{x:Type x:String}"> <x:String>QRCode</x:String> <x:String>Code128</x:String> <x:String>EAN13</x:String> <x:String>Code39</x:String> <x:String>PDF417</x:String> </x:Array> </Picker.ItemsSource> </Picker> <Button Text="Generate & Save" Clicked="OnGenerateButtonClicked" HorizontalOptions="Center" WidthRequest="200" /> <Image x:Name="GeneratedImage" HeightRequest="200" WidthRequest="300" BackgroundColor="#F0F0F0" Aspect="AspectFit" /> <Label x:Name="StatusLabel" FontSize="16" HorizontalOptions="Center" HorizontalTextAlignment="Center" /> </VerticalStackLayout> </ScrollView> </ContentPage> <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MauiApp1.MainPage" BackgroundColor="{DynamicResource PageBackgroundColor}"> <ScrollView> <VerticalStackLayout Spacing="20" Padding="30" VerticalOptions="Center"> <Label Text="Barcode Generator" FontSize="32" HorizontalOptions="Center" /> <Entry x:Name="BarcodeEntry" Placeholder="Enter value (e.g. 12345 or https://ironsoftware.com)" WidthRequest="300" /> <Picker x:Name="BarcodeTypePicker" Title="Select Barcode Type" WidthRequest="300"> <Picker.ItemsSource> <x:Array Type="{x:Type x:String}"> <x:String>QRCode</x:String> <x:String>Code128</x:String> <x:String>EAN13</x:String> <x:String>Code39</x:String> <x:String>PDF417</x:String> </x:Array> </Picker.ItemsSource> </Picker> <Button Text="Generate & Save" Clicked="OnGenerateButtonClicked" HorizontalOptions="Center" WidthRequest="200" /> <Image x:Name="GeneratedImage" HeightRequest="200" WidthRequest="300" BackgroundColor="#F0F0F0" Aspect="AspectFit" /> <Label x:Name="StatusLabel" FontSize="16" HorizontalOptions="Center" HorizontalTextAlignment="Center" /> </VerticalStackLayout> </ScrollView> </ContentPage> XML 데스크톱 바코드 생성기 논리 CS 다음으로, 버튼 클릭 이벤트의 논리가 구현됩니다. UI의 생성 버튼에 OnGenerateButtonClicked 이벤트 핸들러가 연결되어 있습니다. 사용자 입력이 유효한지 확인하여 텍스트가 있고, 유형이 선택된 후에 선택이 올바른 BarcodeEncoding에 매핑됩니다. BarcodeWriter.CreateBarcode는 이미지를 생성하고, 크기를 조정하며, JPEG 이진 데이터로 변환하는 데 사용됩니다. 이미지는 MemoryStream를 사용하여 화면에 표시됩니다. 마지막으로 생성된 바코드 파일을 사용자의 데스크톱에 File.WriteAllBytes를 사용하여 직접 저장하고, 상태 레이블을 업데이트하여 저장 위치를 확인합니다. 참고해 주세요 응용 프로그램을 테스트하기 전에 라이센스 키를 자신의 것으로 교체하세요. using IronBarCode; using System.IO; // Required for saving files namespace MauiApp1 { public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); IronBarCode.License.LicenseKey = "YOUR-KEY"; // Set default selection BarcodeTypePicker.SelectedIndex = 0; } private void OnGenerateButtonClicked(object sender, EventArgs e) { try { // 1. Get and Validate Input string text = BarcodeEntry.Text; if (string.IsNullOrWhiteSpace(text)) { StatusLabel.Text = "Error: Please enter text."; StatusLabel.TextColor = Colors.Red; return; } if (BarcodeTypePicker.SelectedIndex == -1) { StatusLabel.Text = "Error: Please select a type."; StatusLabel.TextColor = Colors.Red; return; } // 2. Determine Encoding Type string selectedType = BarcodeTypePicker.SelectedItem.ToString(); BarcodeEncoding encoding = BarcodeEncoding.QRCode; switch (selectedType) { case "QRCode": encoding = BarcodeEncoding.QRCode; break; case "Code128": encoding = BarcodeEncoding.Code128; break; case "EAN13": encoding = BarcodeEncoding.EAN13; break; case "Code39": encoding = BarcodeEncoding.Code39; break; case "PDF417": encoding = BarcodeEncoding.PDF417; break; } // 3. Generate Barcode var barcode = BarcodeWriter.CreateBarcode(text, encoding); barcode.ResizeTo(400, 200); // Optional resizing // 4. Convert to Bytes (JPEG) var bytes = barcode.ToJpegBinaryData(); // 5. Update UI GeneratedImage.Source = ImageSource.FromStream(() => new MemoryStream(bytes)); // 6. Save to Desktop automatically string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string fileName = $"barcode_{DateTime.Now:yyyyMMdd_HHmmss}.jpg"; string fullPath = Path.Combine(desktopPath, fileName); File.WriteAllBytes(fullPath, bytes); // 7. Show Success Message StatusLabel.Text = $"Saved to Desktop:\n{fileName}"; StatusLabel.TextColor = Colors.Green; } catch (Exception ex) { StatusLabel.Text = $"Error: {ex.Message}"; StatusLabel.TextColor = Colors.Red; } } } } using IronBarCode; using System.IO; // Required for saving files namespace MauiApp1 { public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); IronBarCode.License.LicenseKey = "YOUR-KEY"; // Set default selection BarcodeTypePicker.SelectedIndex = 0; } private void OnGenerateButtonClicked(object sender, EventArgs e) { try { // 1. Get and Validate Input string text = BarcodeEntry.Text; if (string.IsNullOrWhiteSpace(text)) { StatusLabel.Text = "Error: Please enter text."; StatusLabel.TextColor = Colors.Red; return; } if (BarcodeTypePicker.SelectedIndex == -1) { StatusLabel.Text = "Error: Please select a type."; StatusLabel.TextColor = Colors.Red; return; } // 2. Determine Encoding Type string selectedType = BarcodeTypePicker.SelectedItem.ToString(); BarcodeEncoding encoding = BarcodeEncoding.QRCode; switch (selectedType) { case "QRCode": encoding = BarcodeEncoding.QRCode; break; case "Code128": encoding = BarcodeEncoding.Code128; break; case "EAN13": encoding = BarcodeEncoding.EAN13; break; case "Code39": encoding = BarcodeEncoding.Code39; break; case "PDF417": encoding = BarcodeEncoding.PDF417; break; } // 3. Generate Barcode var barcode = BarcodeWriter.CreateBarcode(text, encoding); barcode.ResizeTo(400, 200); // Optional resizing // 4. Convert to Bytes (JPEG) var bytes = barcode.ToJpegBinaryData(); // 5. Update UI GeneratedImage.Source = ImageSource.FromStream(() => new MemoryStream(bytes)); // 6. Save to Desktop automatically string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string fileName = $"barcode_{DateTime.Now:yyyyMMdd_HHmmss}.jpg"; string fullPath = Path.Combine(desktopPath, fileName); File.WriteAllBytes(fullPath, bytes); // 7. Show Success Message StatusLabel.Text = $"Saved to Desktop:\n{fileName}"; StatusLabel.TextColor = Colors.Green; } catch (Exception ex) { StatusLabel.Text = $"Error: {ex.Message}"; StatusLabel.TextColor = Colors.Red; } } } } $vbLabelText $csharpLabel 생성된 바코드가 있는 출력 아시다시피, 응용 프로그램은 생성된 바코드를 표시하고 이를 사용자의 데스크톱에 저장합니다. 출력 실패 일부 바코드 유형은 입력 값에 대한 제한 사항과 형식 요구 사항이 있습니다. 바코드 생성이 실패할 경우, 응용 프로그램은 위와 같이 IronBarcode 예외를 표시합니다. 각 바코드 유형에 대한 형식 지정은 각각의 자세한1D 및 2D를 참조하세요. 위 예제(데스크톱 바코드 스캐너 및 데스크톱 바코드 생성기)를 테스트하려면, 이 샘플 프로젝트를 다운로드 하십시오. 자주 묻는 질문 .NET MAUI란 무엇인가요? .NET MAUI는 C#과 XAML을 사용하여 네이티브 모바일 및 데스크톱 앱을 개발하기 위한 크로스 플랫폼 프레임워크입니다. 개발자는 단일 코드베이스를 사용하여 Android, iOS, macOS 및 Windows용 애플리케이션을 구축할 수 있습니다. .NET MAUI 애플리케이션에서 IronBarcode를 어떻게 사용할 수 있나요? IronBarcode는 .NET MAUI 애플리케이션에 통합하여 바코드 생성 및 스캔 기능을 구현할 수 있습니다. 다양한 데스크톱 플랫폼에서 바코드를 생성하고 읽는 간편한 방법을 제공합니다. IronBarcode는 어떤 종류의 바코드를 생성할 수 있나요? IronBarcode는 QR 코드, Code 128, Code 39, UPC, EAN 등 다양한 바코드 형식을 생성하도록 지원하여 모든 데스크톱 애플리케이션 요구 사항에 맞춰 다용도로 활용할 수 있습니다. IronBarcode로 제작된 데스크톱 애플리케이션으로 바코드를 스캔하는 것이 가능할까요? 네, IronBarcode는 데스크톱 애플리케이션에서 바코드를 스캔하는 데 사용할 수 있으며, 사용자는 애플리케이션 인터페이스를 통해 바코드 정보를 빠르고 효율적으로 해독할 수 있습니다. IronBarcode를 바코드 애플리케이션에 사용하는 장점은 무엇입니까? IronBarcode는 높은 정확도, 속도 및 사용 편의성을 제공합니다. .NET MAUI와 완벽하게 통합되어 데스크톱 애플리케이션에서 바코드 생성 및 스캔을 위한 포괄적인 지원을 제공합니다. IronBarcode는 대용량 바코드 데이터를 처리할 수 있습니까? 네, IronBarcode는 대용량 바코드 데이터를 효율적으로 처리하도록 설계되어 있어 광범위한 바코드 작업을 처리해야 하는 애플리케이션에 적합합니다. 바코드 스캔 및 생성을 위해 별도의 라이브러리가 필요한가요? 아니요, IronBarcode는 단일 라이브러리 내에서 바코드 스캔 및 생성 기능을 모두 제공하여 데스크톱 애플리케이션 개발 프로세스를 간소화합니다. .NET MAUI에서 IronBarcode를 사용하기 위한 시스템 요구 사항은 무엇입니까? IronBarcode는 .NET MAUI와 호환되는 .NET 환경을 필요로 합니다. Windows, macOS 및 .NET MAUI 애플리케이션이 실행될 수 있는 기타 플랫폼을 지원합니다. IronBarcode는 어떻게 바코드 정확성을 보장하나요? IronBarcode는 고급 알고리즘을 사용하여 바코드 생성 및 스캔 모두에서 높은 정밀도를 보장함으로써 바코드 데이터 인코딩 또는 디코딩 오류 발생 가능성을 줄입니다. IronBarcode는 상업용 프로젝트와 개인용 프로젝트 모두에 사용할 수 있나요? 네, IronBarcode는 상업용 및 개인용 프로젝트 모두에 사용할 수 있으며, 다양한 프로젝트 요구 사항에 맞는 유연한 라이선스 옵션을 제공합니다. 커티스 차우 지금 바로 엔지니어링 팀과 채팅하세요 기술 문서 작성자 커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다. 커티스는 개발 분야 외에도 사물 인터넷(IoT)에 깊은 관심을 가지고 있으며, 하드웨어와 소프트웨어를 통합하는 혁신적인 방법을 연구합니다. 여가 시간에는 게임을 즐기거나 디스코드 봇을 만들면서 기술에 대한 애정과 창의성을 결합합니다. 시작할 준비 되셨나요? Nuget 다운로드 2,108,094 | 버전: 2026.3 방금 출시되었습니다 무료 체험 시작하기 NuGet 무료 다운로드 총 다운로드 수: 2,108,094 라이선스 보기 아직도 스크롤하고 계신가요? 빠른 증거를 원하시나요? PM > Install-Package BarCode 샘플을 실행하세요 실이 바코드로 변하는 모습을 지켜보세요. NuGet 무료 다운로드 총 다운로드 수: 2,108,094 라이선스 보기