TX Sheet Control

PictureSource Class

Class
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server from the private NuGet feed or the supplied NuGet folder
Assembly
TXTextControl.TXSheetControl.Api.dll
Install
dotnet add package TXTextControl.TXSheetControl.Server .NET 10 and later.
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll
Implements
IEquatable<PictureSource>

Embedded image bytes or base64; external image URLs are not downloaded.

Syntax

public class PictureSource

Interfaces: IEquatable<PictureSource>.

Members

Constructors

ConstructorDescription
Constructor

Properties

PropertyDescription
AltText
Base64
MimeType

Methods

MethodDescription
FromBytesCreates 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);
}

See Also