RichImageSourceConverter Class
Definition
Converts a URI string into a Avalonia.Controls.Documents.RichImageSource so a
Avalonia.Controls.Documents.RichImage.Source can be authored directly in XAML — for example
<RichImage Source="avares://MyApp/Assets/picture.png" />, or a path
relative to the current XAML file, <RichImage Source="/Assets/picture.png" />.
public class RichImageSourceConverter
Remarks
A relative URI is resolved against the XAML base URI of the document being loaded,
the same way Avalonia.Media.FontFamily and Avalonia's Image.Source
resolve relative asset references. Local assets (avares:/resm: via the
asset loader, or file: from disk) are read immediately and embedded as an
Avalonia.Controls.Documents.EmbeddedImageSource, so the pixels travel with — and serialize with —
the document. Remote images (http:/https:) become a
Avalonia.Controls.Documents.DeferredImageSource that records the URL; the editor shows a placeholder
until a loader resolves it. The MIME type is inferred from the file extension.
Constructors
| Name | Description |
|---|---|
| RichImageSourceConverter | No summary available. |
RichImageSourceConverter Constructor
public RichImageSourceConverter()
Methods
| Name | Description |
|---|---|
| CanConvertFrom | No summary available. |
| ConvertFrom | No summary available. |
CanConvertFrom Method
public bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType)
Parameters
context System.ComponentModel.ITypeDescriptorContext
sourceType Type
Returns
bool
ConvertFrom Method
public object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
Parameters
context System.ComponentModel.ITypeDescriptorContext
culture System.Globalization.CultureInfo
value object
Returns
object