TX Sheet Control

PictureSource Constructor

Constructor
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server as TXTextControl.TXSheetControl.Api.dll from the private NuGet feed or the supplied NuGet folder
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll

Syntax

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

Parameters

ParameterTypeOptionalDescription
Base64stringNoValue matching Base64's declared type and the owning object's validation rules.
MimeTypestring?YesValue matching MimeType's declared type and the owning object's validation rules.
AltTextstring?YesValue 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.

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