Erstellung einer Desktop BarCode Anwendung (Scanner/Generator) mit .NET MAUI
Bei einer umfassenden Softwarelösung geht es nicht nur um mobile Zugänglichkeit. Die Fähigkeit zur nativen Bereitstellung auf Desktop-Betriebssystemen wie Windows und macOS ist ebenso wichtig. Dieser plattformübergreifende Ansatz ermöglicht es Unternehmen, die volle Leistung von Workstations für hochvolumige Aufgaben wie Asset-Tracking und Verwaltung zu nutzen.
Ohne angemessene Desktop-Unterstützung werden Arbeitsabläufe unterbrochen oder, schlimmer noch, auf weniger leistungsfähige Geräte verlagert. Dies ist besonders wichtig in der Bestandsverwaltung, wo Büromitarbeiter schnell Stapel von Codes erstellen oder Scans überprüfen müssen, ohne ihren Schreibtisch zu verlassen.
IronBarcode liefert die notwendigen Tools zur Implementierung dieser Funktionen, damit Ihre .NET MAUI-Anwendung auf jedem Computer zuverlässig funktioniert.
In diesem Artikel wird erklärt, wie IronBarcode integriert werden kann, um sowohl einen Desktop Barcode Scanner als auch einen Desktop Barcode Generator zu erstellen.
Erstellen einer Desktop-Barcode-Anwendung mit .NET MAUI in C#
- Laden Sie die IronBarcode C#-Bibliothek herunter, um sie mit .NET MAUI (Desktop-Plattform-Framework) zu integrieren
- Lesen Sie den hochgeladenen Barcode, der vom Benutzer mit
Readbereitgestellt wurde - Anzeige des Barcodewertes auf der .NET MAUI UI
- Erzeugen Sie einen BarCode mit einem String-Wert mit
CreateBarcode - Anzeige des generierten Barcodes in der .NET MAUI UI und Speicherung als Bild
.NET MAUI Desktop-Anwendung
Die Integration von IronBarcode in eine .NET MAUI-Anwendung ist einfach, da die Bibliothek von Anfang an mit der Desktop-Plattform zusammenarbeitet. In diesem Beispiel werden wir sowohl einen Barcode-Scanner als auch einen Barcode-Generator mit IronBarcode separat erstellen.
Beginnen wir zuerst mit dem BarCode-Scanner.
Barcode-Scanner-Schnittstelle XAML
Für die .NET MAUI-Schnittstelle wird eine einfache Schnittstelle implementiert, die es den Benutzern ermöglicht, Barcode-Bilder über eine Schaltfläche hochzuladen. Die MainPage.xaml-Datei im Projekt sollte durch die unten angezeigten Inhalte ersetzt werden.
<?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>
Desktop BarCode Scanner Logic CS
Als Nächstes wird die Logik implementiert, die entsteht, wenn der Benutzer auf die Schaltfläche klickt. Ein OnScanButtonClicked-Ereignishandler ist an die Scan-Schaltfläche in der Benutzeroberfläche angehängt.
PickPhotoAsync wird zuerst verwendet, um die Benutzer das Barcode zum Hochladen auswählen zu lassen, gefolgt von OpenReadAsync, um auf den Dateistrom zuzugreifen. Die Bilddaten werden sofort in eine MemoryStream unter Verwendung von CopyToAsync kopiert. Dies ermöglicht es, die Daten gleichzeitig zur Anzeige des Bildes auf dem Bildschirm und für die Read-Methode zum Scannen des Barcodes zu verwenden.
Schließlich wird der Barcodewert in der Benutzeroberfläche angezeigt, wenn ein gültiger Barcode erkannt wird, oder es wird eine rote Meldung angezeigt, die besagt, dass kein Barcode im Bild gefunden wurde.
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;
}
}
}
}Imports IronBarCode
Namespace MauiApp1
Public Partial Class MainPage
Inherits ContentPage
Public Sub New()
InitializeComponent()
' Your license key is set here
IronBarCode.License.LicenseKey = "YOUR_KEY"
End Sub
Private Async Sub OnScanButtonClicked(sender As Object, e As EventArgs)
Try
Dim fileResult = Await MediaPicker.Default.PickPhotoAsync()
If fileResult IsNot Nothing Then
' 1. Copy the file content into a byte array or MemoryStream immediately
' This ensures we have the data in memory before the file closes
Dim imageBytes As Byte()
Using stream = Await fileResult.OpenReadAsync(), memoryStream = New MemoryStream()
Await stream.CopyToAsync(memoryStream)
imageBytes = memoryStream.ToArray()
End Using
' 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(Function() New MemoryStream(imageBytes))
' 3. Process the Barcode
' We give IronBarcode its OWN fresh stream from the same bytes
Using processingStream = New MemoryStream(imageBytes)
' 4. Read the barcode with Read
Dim results = BarcodeReader.Read(processingStream)
' 5. Display barcode results
If results IsNot Nothing AndAlso results.Count > 0 Then
' 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
End If
End Using
End If
Catch ex As Exception
' Display any exception thrown in runtime
ResultLabel.Text = $"Error: {ex.Message}"
ResultLabel.TextColor = Colors.Red
End Try
End Sub
End Class
End NamespaceImports IronBarCode
Namespace MauiApp1
Public Partial Class MainPage
Inherits ContentPage
Public Sub New()
InitializeComponent()
' Your license key is set here
IronBarCode.License.LicenseKey = "YOUR_KEY"
End Sub
Private Async Sub OnScanButtonClicked(sender As Object, e As EventArgs)
Try
Dim fileResult = Await MediaPicker.Default.PickPhotoAsync()
If fileResult IsNot Nothing Then
' 1. Copy the file content into a byte array or MemoryStream immediately
' This ensures we have the data in memory before the file closes
Dim imageBytes As Byte()
Using stream = Await fileResult.OpenReadAsync(), memoryStream = New MemoryStream()
Await stream.CopyToAsync(memoryStream)
imageBytes = memoryStream.ToArray()
End Using
' 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(Function() New MemoryStream(imageBytes))
' 3. Process the Barcode
' We give IronBarcode its OWN fresh stream from the same bytes
Using processingStream = New MemoryStream(imageBytes)
' 4. Read the barcode with Read
Dim results = BarcodeReader.Read(processingStream)
' 5. Display barcode results
If results IsNot Nothing AndAlso results.Count > 0 Then
' 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
End If
End Using
End If
Catch ex As Exception
' Display any exception thrown in runtime
ResultLabel.Text = $"Error: {ex.Message}"
ResultLabel.TextColor = Colors.Red
End Try
End Sub
End Class
End NamespaceAusgabe mit BarCode-Wert gefunden

Wie Sie sehen können, zeigt die Anwendung das Barcode-Ergebnis und das hochgeladene Barcode-Bild an.
Ausgabe ohne BarCode-Wert gefunden

Wenn ein Benutzer ein Bild hochlädt, das keinen Barcode enthält, erscheint die rote Meldung "Keine Barcodes gefunden."
Generator für Desktop BarCodes
Der nächste Teil baut auf demselben Konzept auf, indem IronBarcode in MAUI integriert wird, um einen Barcode-Generator zu erstellen.
BarCode Generator Schnittstelle XAML
Für die Schnittstelle des Generators wurde ein einfaches Formular implementiert, das die Texteingabe und die Auswahl des Barcodetyps über ein Dropdown-Menü ermöglicht. Eine Schaltfläche zum Auslösen des Erstellungs- und Speichervorgangs ist ebenso enthalten wie eine Bildansicht zur Darstellung des Ergebnisses. Die MainPage.xaml-Datei sollte durch die unten gezeigten Inhalte ersetzt werden.
Bitte sehen Sie hier für die vollständige Liste der 1D-Barcodes und hier für 2D-Barcodes.
<?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>
Desktop BarCode Generator Logic CS
Als nächstes wird die Logik für das Schaltflächenklick-Ereignis implementiert. Ein OnGenerateButtonClicked-Ereignishandler ist an die Generieren-Schaltfläche in der Benutzeroberfläche angehängt.
Benutzereingaben werden validiert, um sicherzustellen, dass Text vorhanden ist und ein Typ ausgewählt wurde, danach wird die Auswahl dem richtigen BarcodeEncoding zugeordnet. BarcodeWriter.CreateBarcode wird verwendet, um das Bild zu erzeugen, dessen Größe zu ändern und es in JPEG-Binärdaten zu konvertieren. Das Bild wird dann mit einem MemoryStream auf dem Bildschirm angezeigt.
Schließlich wird die generierte Barcodedatei direkt auf dem Desktop des Benutzers mithilfe von File.WriteAllBytes gespeichert, und das Statuslabel wird aktualisiert, um den Speicherort zu bestätigen.
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;
}
}
}
}Imports IronBarCode
Imports System.IO ' Required for saving files
Namespace MauiApp1
Public Partial Class MainPage
Inherits ContentPage
Public Sub New()
InitializeComponent()
IronBarCode.License.LicenseKey = "YOUR-KEY"
' Set default selection
BarcodeTypePicker.SelectedIndex = 0
End Sub
Private Sub OnGenerateButtonClicked(sender As Object, e As EventArgs)
Try
' 1. Get and Validate Input
Dim text As String = BarcodeEntry.Text
If String.IsNullOrWhiteSpace(text) Then
StatusLabel.Text = "Error: Please enter text."
StatusLabel.TextColor = Colors.Red
Return
End If
If BarcodeTypePicker.SelectedIndex = -1 Then
StatusLabel.Text = "Error: Please select a type."
StatusLabel.TextColor = Colors.Red
Return
End If
' 2. Determine Encoding Type
Dim selectedType As String = BarcodeTypePicker.SelectedItem.ToString()
Dim encoding As BarcodeEncoding = BarcodeEncoding.QRCode
Select Case selectedType
Case "QRCode"
encoding = BarcodeEncoding.QRCode
Case "Code128"
encoding = BarcodeEncoding.Code128
Case "EAN13"
encoding = BarcodeEncoding.EAN13
Case "Code39"
encoding = BarcodeEncoding.Code39
Case "PDF417"
encoding = BarcodeEncoding.PDF417
End Select
' 3. Generate Barcode
Dim barcode = BarcodeWriter.CreateBarcode(text, encoding)
barcode.ResizeTo(400, 200) ' Optional resizing
' 4. Convert to Bytes (JPEG)
Dim bytes = barcode.ToJpegBinaryData()
' 5. Update UI
GeneratedImage.Source = ImageSource.FromStream(Function() New MemoryStream(bytes))
' 6. Save to Desktop automatically
Dim desktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim fileName As String = $"barcode_{DateTime.Now:yyyyMMdd_HHmmss}.jpg"
Dim fullPath As String = Path.Combine(desktopPath, fileName)
File.WriteAllBytes(fullPath, bytes)
' 7. Show Success Message
StatusLabel.Text = $"Saved to Desktop:{Environment.NewLine}{fileName}"
StatusLabel.TextColor = Colors.Green
Catch ex As Exception
StatusLabel.Text = $"Error: {ex.Message}"
StatusLabel.TextColor = Colors.Red
End Try
End Sub
End Class
End NamespaceImports IronBarCode
Imports System.IO ' Required for saving files
Namespace MauiApp1
Public Partial Class MainPage
Inherits ContentPage
Public Sub New()
InitializeComponent()
IronBarCode.License.LicenseKey = "YOUR-KEY"
' Set default selection
BarcodeTypePicker.SelectedIndex = 0
End Sub
Private Sub OnGenerateButtonClicked(sender As Object, e As EventArgs)
Try
' 1. Get and Validate Input
Dim text As String = BarcodeEntry.Text
If String.IsNullOrWhiteSpace(text) Then
StatusLabel.Text = "Error: Please enter text."
StatusLabel.TextColor = Colors.Red
Return
End If
If BarcodeTypePicker.SelectedIndex = -1 Then
StatusLabel.Text = "Error: Please select a type."
StatusLabel.TextColor = Colors.Red
Return
End If
' 2. Determine Encoding Type
Dim selectedType As String = BarcodeTypePicker.SelectedItem.ToString()
Dim encoding As BarcodeEncoding = BarcodeEncoding.QRCode
Select Case selectedType
Case "QRCode"
encoding = BarcodeEncoding.QRCode
Case "Code128"
encoding = BarcodeEncoding.Code128
Case "EAN13"
encoding = BarcodeEncoding.EAN13
Case "Code39"
encoding = BarcodeEncoding.Code39
Case "PDF417"
encoding = BarcodeEncoding.PDF417
End Select
' 3. Generate Barcode
Dim barcode = BarcodeWriter.CreateBarcode(text, encoding)
barcode.ResizeTo(400, 200) ' Optional resizing
' 4. Convert to Bytes (JPEG)
Dim bytes = barcode.ToJpegBinaryData()
' 5. Update UI
GeneratedImage.Source = ImageSource.FromStream(Function() New MemoryStream(bytes))
' 6. Save to Desktop automatically
Dim desktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim fileName As String = $"barcode_{DateTime.Now:yyyyMMdd_HHmmss}.jpg"
Dim fullPath As String = Path.Combine(desktopPath, fileName)
File.WriteAllBytes(fullPath, bytes)
' 7. Show Success Message
StatusLabel.Text = $"Saved to Desktop:{Environment.NewLine}{fileName}"
StatusLabel.TextColor = Colors.Green
Catch ex As Exception
StatusLabel.Text = $"Error: {ex.Message}"
StatusLabel.TextColor = Colors.Red
End Try
End Sub
End Class
End NamespaceAusgabe mit generiertem BarCode

Wie Sie sehen können, zeigt die Anwendung den generierten Barcode an und speichert ihn auf dem Desktop des Benutzers.
Ausgabefehler

Bestimmte Barcodetypen haben Einschränkungen und Formatanforderungen für den Eingabewert. Wenn der Barcode nicht generiert werden kann, zeigt die Anwendung die IronBarcode-Ausnahme an, wie oben dargestellt. Bitte beachten Sie das entsprechende detaillierte 1D und 2D Formatierung für jeden Barcode-Typ.
Um die obigen Beispiele (Desktop Barcode Scanner und den Desktop Barcode Generator) zu testen, laden Sie bitte dieses Beispielprojekt herunter.
Häufig gestellte Fragen
Was ist der Zweck der Integration von IronBarcode in eine .NET MAUI Desktop-Anwendung?
Die Integration von IronBarcode in eine .NET MAUI-Anwendung ermöglicht es Entwicklern, eine plattformübergreifende Barcode-Scanner- und -Generatorlösung zu erstellen, die direkt auf Desktop-Umgebungen wie Windows und macOS arbeiten kann, wodurch Workflows wie Bestandsmanagement und Anlagenverfolgung verbessert werden.
Wie implementiert man einen Desktop-Barcode-Scanner in .NET MAUI mit IronBarcode?
Um einen Barcode-Scanner zu implementieren, verwenden Sie die Read-Methode von IronBarcode, um ein vom Benutzer hochgeladenes Barcode-Bild zu scannen und die Ergebnisse in der .NET MAUI-Benutzeroberfläche anzuzeigen. Dies umfasst die Handhabung von Benutzereingaben, die Verarbeitung von Barcode-Daten und die Aktualisierung der Benutzeroberfläche mit den Scan-Ergebnissen.
Wie kann ein Desktop-Barcode-Generator mit IronBarcode erstellt werden?
Ein Desktop-Barcode-Generator kann mit IronBarcode in .NET MAUI erstellt werden, indem eine Benutzeroberfläche für die Texteingabe und die Auswahl des Barcodetyps bereitgestellt wird. Anschließend verwenden Sie BarcodeWriter.CreateBarcode, um das Barcode-Bild zu erzeugen, es anzuzeigen und auf dem Desktop des Benutzers zu speichern.
Welche Dateitypen werden für das Speichern von Barcode-Bildern im IronBarcode Generator unterstützt?
IronBarcode unterstützt das Speichern von Barcode-Bildern in mehreren Formaten, einschließlich JPEG. Die Beispielimplementierung speichert das erzeugte Barcode-Bild als JPEG-Datei.
Kann IronBarcode verschiedene Arten von Barcodes in einer Desktop-Anwendung verarbeiten?
Ja, IronBarcode kann verschiedene Barcode-Typen wie QRCode, Code128, EAN13, Code39 und PDF417 verarbeiten, was Flexibilität beim Erstellen und Lesen verschiedener Barcode-Formate innerhalb einer Desktop-Anwendung ermöglicht.
Welche Rolle spielt `OnScanButtonClicked` in der Barcode-Scanner-Logik?
OnScanButtonClicked ist ein Ereignishandler, der ausgelöst wird, wenn der Benutzer die Scan-Schaltfläche klickt. Er verwaltet den Prozess des Auswählens, Lesens und Anzeigens des Barcode-Bildes mit IronBarcode in der .NET MAUI-Benutzeroberfläche.
Warum ist plattformübergreifende Funktionalität für Desktop-Barcode-Anwendungen wichtig?
Plattformübergreifende Funktionalität stellt sicher, dass die Barcode-Anwendung nativ auf verschiedenen Desktop-Betriebssystemen wie Windows und macOS ausgeführt werden kann, sodass Unternehmen leistungsstarke Arbeitsstationen für Aufgaben wie Bestandsverfolgung und Bestandsmanagement nutzen können.
Wie verbessert IronBarcode die Workflow-Effizienz im Kontext von Barcode-Anwendungen?
Indem die Barcode-Erzeugung und -Abtastung direkt in Desktop-Umgebungen ermöglicht wird, verbessert IronBarcode die Workflow-Effizienz, indem die Abhängigkeit von mobilen Geräten reduziert wird, wodurch Unterbrechungen minimiert und die Geschwindigkeit von Aufgaben wie der Stapelcode-Erzeugung und der Scan-Verifizierung in Büroeinrichtungen erhöht wird.
Curtis Chau hat einen Bachelor-Abschluss in Informatik von der Carleton University und ist spezialisiert auf Frontend-Entwicklung mit Expertise in Node.js, TypeScript, JavaScript und React. Leidenschaftlich widmet er sich der Erstellung intuitiver und ästhetisch ansprechender Benutzerschnittstellen und arbeitet gerne mit modernen Frameworks sowie der Erstellung gut strukturierter, optisch ansprechender Handbücher.