PictureSource Class
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
- Implements
- IEquatable<Picture
Source>
Embedded image bytes or base64; external image URLs are not downloaded.
Syntax
public class PictureSource
Interfaces: IEquatable<PictureSource>.
Members
Constructors
| Constructor | Description |
|---|---|
| Constructor |
Properties
Methods
| Method | Description |
|---|---|
| FromBytes | Creates or updates a document-bound handle or queued operation; the owning workbook retains validation authority. |
Examples
Create a working document workflow using PictureSource. Return the generated document or application data to the caller.
using TXTextControl.TXSheetControl.Server;
async Task<byte[]> BuildPictureSourceExampleAsync(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);
}