Table of Contents

Class OdfTemplateImageValue

Namespace
OdfKit
Assembly
OdfKit.dll

Represents an image value used by {{Image:Name}} template placeholders. 表示供 {{Image:Name}} 模板圖片占位符使用的圖片值。

public sealed record OdfTemplateImageValue : IEquatable<OdfTemplateImageValue>
Inheritance
OdfTemplateImageValue
Implements
Inherited Members

Constructors

OdfTemplateImageValue(byte[], string, string, OdfLength?, OdfLength?, string?)

Represents an image value used by {{Image:Name}} template placeholders. 表示供 {{Image:Name}} 模板圖片占位符使用的圖片值。

public OdfTemplateImageValue(byte[] Bytes, string FileName, string MediaType = "image/png", OdfLength? Width = null, OdfLength? Height = null, string? AltText = null)

Parameters

Bytes byte[]

The image bytes. / 圖片位元組。

FileName string

The preferred package file name. / 偏好的封裝檔名。

MediaType string

The image media type. / 圖片 MIME 類型。

Width OdfLength?

The optional display width. / 選用顯示寬度。

Height OdfLength?

The optional display height. / 選用顯示高度。

AltText string

The optional alternative text. / 選用替代文字。

Properties

AltText

The optional alternative text. / 選用替代文字。

public string? AltText { get; init; }

Property Value

string

Bytes

The image bytes. / 圖片位元組。

public byte[] Bytes { get; init; }

Property Value

byte[]

FileName

The preferred package file name. / 偏好的封裝檔名。

public string FileName { get; init; }

Property Value

string

Height

The optional display height. / 選用顯示高度。

public OdfLength? Height { get; init; }

Property Value

OdfLength?

MediaType

The image media type. / 圖片 MIME 類型。

public string MediaType { get; init; }

Property Value

string

Width

The optional display width. / 選用顯示寬度。

public OdfLength? Width { get; init; }

Property Value

OdfLength?

Methods

Deconstruct(out byte[], out string, out string, out OdfLength?, out OdfLength?, out string?)

public void Deconstruct(out byte[] Bytes, out string FileName, out string MediaType, out OdfLength? Width, out OdfLength? Height, out string? AltText)

Parameters

Bytes byte[]
FileName string
MediaType string
Width OdfLength?
Height OdfLength?
AltText string

Equals(OdfTemplateImageValue?)

public bool Equals(OdfTemplateImageValue? other)

Parameters

other OdfTemplateImageValue

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(OdfTemplateImageValue?, OdfTemplateImageValue?)

public static bool operator ==(OdfTemplateImageValue? left, OdfTemplateImageValue? right)

Parameters

left OdfTemplateImageValue
right OdfTemplateImageValue

Returns

bool

operator !=(OdfTemplateImageValue?, OdfTemplateImageValue?)

public static bool operator !=(OdfTemplateImageValue? left, OdfTemplateImageValue? right)

Parameters

left OdfTemplateImageValue
right OdfTemplateImageValue

Returns

bool