# BarcodeDrawingOptions Class

> BarcodeDrawingOptions class in the TX Sheet Control .NET API: Floating barcode settings, inheriting BarcodeOptions and using ordinary drawing placement.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Inherits:** `TXTextControl.TXSheetControl.Server.BarcodeOptions`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > BarcodeDrawingOptions Class
- **1141 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/llms-full.txt

---

Floating barcode settings, inheriting BarcodeOptions and using ordinary drawing placement.

### Syntax

```csharp
public sealed class BarcodeDrawingOptions : BarcodeOptions
{
    public DrawingAnchor? Anchor { get; init; }
    public ObjectSize? Size { get; init; }
    public string? Name { get; init; }
    public string? AltText { get; init; }
    public double? Rotation { get; init; }
}
```

### Remarks

See [Barcodes and QR Codes](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/barcodes/llms-full.txt) for a complete .NET example, source validation, mail merge and file compatibility.

- [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/constructor/llms-full.txt) — Creates settings.
- [Anchor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/anchor-property/llms-full.txt) — Anchor cell and optional CSS-pixel offsets. Defaults to A1.
- [Size](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/size-property/llms-full.txt) — Width and height in unscaled CSS pixels. Defaults to 160×160 for QR or 280×100 for linear codes.
- [Name](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/name-property/llms-full.txt) — Drawing name; defaults to Barcode.
- [AltText](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/alttext-property/llms-full.txt) — Accessibility description for the drawing.
- [Rotation](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/rotation-property/llms-full.txt) — Clockwise rotation in degrees.

### Constructor

```csharp
public BarcodeDrawingOptions()
```

Creates an instance with the property defaults shown in this reference. Settings are validated when applied to the owning document; result objects obtained from document operations are detached snapshots.

### Examples

Create and save a label workbook with the configured barcode settings.

```csharp
using TXTextControl.TXSheetControl.Server;

static async Task<byte[]> CreateFloatingLabelAsync(ServerSheetControl control)
{
    var sheet = await control.Workbook.Sheets.AtAsync(0);
    await sheet.Cell("A1").SetTextAsync("001042");
    var options = new BarcodeDrawingOptions {
        Symbology = "code128", Source = "A1", Anchor = new DrawingAnchor("D4", 8, 8),
        Size = new ObjectSize(240, 100), Name = "Invoice barcode", AltText = "Invoice identifier", Rotation = 0
    };
    var drawing = await sheet.Drawings.AddBarcodeAsync(options);
    var snapshot = await drawing.GetBarcodeAsync();
    await drawing.UpdateBarcodeAsync(new BarcodeOptions { Symbology = "code128", Source = "A1", ShowText = false });
    return await control.SaveAsync(StreamType.SpreadsheetML);
}
```

---

## In This Section

- [BarcodeDrawingOptions.AltText Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/alttext-property/llms-full.txt): BarcodeDrawingOptions.AltText property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.
- [BarcodeDrawingOptions.Anchor Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/anchor-property/llms-full.txt): BarcodeDrawingOptions.Anchor property in the TX Sheet Control .NET API: Anchor cell and optional CSS-pixel offsets. Defaults to A1.
- [BarcodeDrawingOptions Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/constructor/llms-full.txt): BarcodeDrawingOptions constructor in the .NET API: Creates floating barcode settings; Symbology defaults to code128 and optional settings stay null.
- [BarcodeDrawingOptions.Name Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/name-property/llms-full.txt): BarcodeDrawingOptions.Name property in the TX Sheet Control .NET API: Drawing name; defaults to Barcode. Shown with its type string? and a C# example.
- [BarcodeDrawingOptions.Rotation Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/rotation-property/llms-full.txt): BarcodeDrawingOptions.Rotation property in the TX Sheet Control .NET API: Clockwise rotation in degrees. Shown with its type double? and a C# example.
- [BarcodeDrawingOptions.Size Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/size-property/llms-full.txt): BarcodeDrawingOptions.Size property in the TX Sheet Control .NET API, with its syntax, its type ObjectSize? and a C# example.

---

## Nearby

- **Previous:** [BarcodeOptions.Version Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodeoptions/version-property/llms-full.txt)
- **Next:** [BarcodeDrawingOptions Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodedrawingoptions/constructor/llms-full.txt)
