# PictureSource Constructor

> PictureSource constructor in the TX Sheet Control .NET API, with the parameters Base64, MimeType and AltText and a C# example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Constructor
- **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)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > PictureSource > PictureSource Constructor
- **701 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/picturesource/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/picturesource/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/picturesource/constructor/llms-full.txt

---

### Syntax

```csharp
public PictureSource(string Base64, string? MimeType = null, string? AltText = null)
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `Base64` | `string` | No | Value matching Base64's declared type and the owning object's validation rules. |
| `MimeType` | `string?` | Yes | Value matching MimeType's declared type and the owning object's validation rules. |
| `AltText` | `string?` | Yes | Value matching AltText's declared type and the owning object's validation rules. |

### Return Value

`PictureSource`.

### Examples

Create a working document workflow using PictureSource. Return the generated document or application data to the caller.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> BuildPictureSourceConstructorAsync(ServerSheetControl control, byte[] logoPng)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    var logo = PictureSource.FromBytes(logoPng, "image/png", "Alpine Design logo");
    await sheet.Drawings.AddPictureAsync(new { source = logo, anchor = new { cell = "A1" }, size = new { width = 160, height = 60 } });
    return await control.SaveAsync(StreamType.PDF);
}
```

### Remarks

Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.

### See Also

- [PictureSource Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/picturesource/llms-full.txt)
- [Pictures and Shapes](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/pictures-shapes/llms-full.txt)

---

## Nearby

- **Previous:** [PictureSource Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/picturesource/llms-full.txt)
- **Next:** [PictureSource.AltText Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/picturesource/alttext-property/llms-full.txt)
