Table of Contents

Class ImageExtensions

Namespace
TcgDex.Models
Assembly
TcgDex.CSharpSdk.dll

Image URL helpers for the types that carry artwork.

public static class ImageExtensions

Inheritance

Inherited Members

Methods

GetImageUrl(Card, ImageQuality, ImageFormat)

Builds the URL for this card's artwork.

public static string? GetImageUrl(this Card card, ImageQuality quality = ImageQuality.High, ImageFormat format = ImageFormat.Png)

Parameters

card Card

The card.

quality ImageQuality

The resolution to request.

format ImageFormat

The file format to request.

Returns

string?

The image URL, or null when the card has no artwork.

Exceptions

ArgumentNullException

card is null.

GetImageUrl(CardBrief, ImageQuality, ImageFormat)

Builds the URL for this card's artwork.

public static string? GetImageUrl(this CardBrief card, ImageQuality quality = ImageQuality.High, ImageFormat format = ImageFormat.Png)

Parameters

card CardBrief

The card brief.

quality ImageQuality

The resolution to request.

format ImageFormat

The file format to request.

Returns

string?

The image URL, or null when the card has no artwork.

Exceptions

ArgumentNullException

card is null.

GetLogoUrl(SetBrief, ImageFormat)

Builds the URL for this set's logo.

public static string? GetLogoUrl(this SetBrief set, ImageFormat format = ImageFormat.Png)

Parameters

set SetBrief

The set.

format ImageFormat

The file format to request.

Returns

string?

The logo URL, or null when the set has none.

Remarks

Takes no quality: logos are served at a single resolution, unlike card artwork.

Exceptions

ArgumentNullException

set is null.

GetLogoUrl(Set, ImageFormat)

Builds the URL for this set's logo.

public static string? GetLogoUrl(this Set set, ImageFormat format = ImageFormat.Png)

Parameters

set Set

The set.

format ImageFormat

The file format to request.

Returns

string?

The logo URL, or null when the set has none.

Exceptions

ArgumentNullException

set is null.

GetSymbolUrl(SetBrief, ImageFormat)

Builds the URL for this set's symbol.

public static string? GetSymbolUrl(this SetBrief set, ImageFormat format = ImageFormat.Png)

Parameters

set SetBrief

The set.

format ImageFormat

The file format to request.

Returns

string?

The symbol URL, or null when the set has none.

Remarks

Takes no quality, and is served language-neutral rather than from the requested language's path.

Exceptions

ArgumentNullException

set is null.

GetSymbolUrl(Set, ImageFormat)

Builds the URL for this set's symbol.

public static string? GetSymbolUrl(this Set set, ImageFormat format = ImageFormat.Png)

Parameters

set Set

The set.

format ImageFormat

The file format to request.

Returns

string?

The symbol URL, or null when the set has none.

Exceptions

ArgumentNullException

set is null.