Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

HtmlImageDataUri

OfficeIMO.Html

Namespace
OfficeIMO.Html
Assembly
OfficeIMO.Html
Source revision
be6c300e4ab1 with working tree changes
Modifiers
sealed

Represents an image data URI split into media type, encoding metadata, and payload.

Inheritance

  • object
  • HtmlImageDataUri

Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 1

Methods

public byte[] DecodeBytes() #

Decodes the image payload as bytes.

Returns

byte[]
public string DecodeText() #

Decodes the payload using its declared charset, or UTF-8 when none is declared.

Returns

string
public long EstimateDecodedByteCount() #

Estimates decoded byte count without allocating decoded content when possible.

Returns

long
public static string GetFileExtension(string mediaType) #

Gets the suggested file extension for an image media type.

Parameters

mediaType string required

Returns

string
public bool TryDecodeBytes(out byte[] bytes) #

Attempts to decode the image payload as bytes.

Parameters

bytes byte[] required

Returns

bool
public bool TryDecodeText(out string text) #

Attempts to decode the payload using its declared charset, or UTF-8 when none is declared.

Parameters

text string required

Returns

bool
public bool TryEstimateDecodedByteCount(out long byteCount) #

Attempts to estimate decoded byte count without throwing for malformed payloads.

Parameters

byteCount long required

Returns

bool
public static bool TryParse(string? source, out HtmlImageDataUri dataUri) #

Tries to parse an image data URI.

Parameters

source string? required
dataUri OfficeIMO.Html.HtmlImageDataUri required

Returns

bool

Properties

public string Metadata { get; } #

Data URI metadata without the leading data: prefix.

public string MediaType { get; } #

Declared image media type, for example image/png.

public string Data { get; } #

Raw payload after the comma separator.

public bool IsBase64 { get; } #

Indicates whether the payload is base64 encoded.

public string Fragment { get; } #

URL fragment suffix, including the leading hash when present.

public string FileExtension { get; } #

Suggested file extension for the media type, including the leading dot.