HtmlImageDataUri
OfficeIMO.Html
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
- Method HtmlImageDataUri.TryParse
Methods
public string DecodeText() #Decodes the payload using its declared charset, or UTF-8 when none is declared.
Returns
stringpublic long EstimateDecodedByteCount() #Estimates decoded byte count without allocating decoded content when possible.
Returns
longpublic static string GetFileExtension(string mediaType) #Gets the suggested file extension for an image media type.
Parameters
- mediaType string
Returns
stringpublic bool TryDecodeBytes(out byte[] bytes) #Attempts to decode the image payload as bytes.
Parameters
- bytes byte[]
Returns
boolpublic bool TryDecodeText(out string text) #Attempts to decode the payload using its declared charset, or UTF-8 when none is declared.
Parameters
- text string
Returns
boolpublic bool TryEstimateDecodedByteCount(out long byteCount) #Attempts to estimate decoded byte count without throwing for malformed payloads.
Parameters
- byteCount long
Returns
boolpublic static bool TryParse(string? source, out HtmlImageDataUri dataUri) #Tries to parse an image data URI.
Parameters
- source string?
- dataUri OfficeIMO.Html.HtmlImageDataUri
Returns
boolInherited Methods
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 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.