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 Uri? 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

Uri?

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 Uri? 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

Uri?

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

Exceptions

ArgumentNullException

card is null.

GetLogoUrl(CardSetBrief, ImageFormat)

Builds the URL for this set's logo.

public static Uri? GetLogoUrl(this CardSetBrief set, ImageFormat format = ImageFormat.Png)

Parameters

set CardSetBrief

The set.

format ImageFormat

The file format to request.

Returns

Uri?

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(CardSet, ImageFormat)

Builds the URL for this set's logo.

public static Uri? GetLogoUrl(this CardSet set, ImageFormat format = ImageFormat.Png)

Parameters

set CardSet

The set.

format ImageFormat

The file format to request.

Returns

Uri?

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

Exceptions

ArgumentNullException

set is null.

GetSymbolUrl(CardSetBrief, ImageFormat)

Builds the URL for this set's symbol.

public static Uri? GetSymbolUrl(this CardSetBrief set, ImageFormat format = ImageFormat.Png)

Parameters

set CardSetBrief

The set.

format ImageFormat

The file format to request.

Returns

Uri?

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(CardSet, ImageFormat)

Builds the URL for this set's symbol.

public static Uri? GetSymbolUrl(this CardSet set, ImageFormat format = ImageFormat.Png)

Parameters

set CardSet

The set.

format ImageFormat

The file format to request.

Returns

Uri?

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

Exceptions

ArgumentNullException

set is null.