Class AvaloniaAssets
Handles Avalonia resources.
public static class AvaloniaAssets
- Inheritance
-
AvaloniaAssets
- Inherited Members
Methods
Combine(string, params string[])
Combines parts into an Avalonia asset URI
public static string Combine(string BasePath, params string[] Parts)
Parameters
Returns
CreateImage(ImageSizeType, Size?)
Creates an image of a specified size.
public static Image CreateImage(ImageSizeType SizeType, Size? Size = null)
Parameters
SizeTypeImageSizeTypeSizeSize?
Returns
- Image
FindAsset(string)
Finds and returns an asset as a stream, if any, else null.
WARNING: The returned stream should be disposed by the caller.
public static Stream FindAsset(string FileName)
Parameters
FileNamestring
Returns
FindImage(string)
Returns an image of any size, if found in assets, else null.
NOTE: It searches the application assemblies too.
public static Image FindImage(string FileName)
Parameters
FileNamestring
Returns
- Image
FindImage(string, Size)
Returns an image of a specified size, if found in assets, else null.
NOTE: It searches the application assemblies too.
public static Image FindImage(string FileName, Size Size)
Parameters
FileNamestringSizeSize
Returns
- Image
FindImage(string, ImageSizeType, Size?)
Returns an image of a specified size, if found in assets, else null.
NOTE: It searches the application assemblies too.
public static Image FindImage(string FileName, ImageSizeType SizeType, Size? Size = null)
Parameters
FileNamestringSizeTypeImageSizeTypeSizeSize?
Returns
- Image
FindImage16(string)
Returns an image of a specified size, if found in assets, else null.
NOTE: It searches the application assemblies too.
public static Image FindImage16(string FileName)
Parameters
FileNamestring
Returns
- Image
FindImage32(string)
Returns an image of a specified size, if found in assets, else null.
NOTE: It searches the application assemblies too.
public static Image FindImage32(string FileName)
Parameters
FileNamestring
Returns
- Image
FindUri(string)
Finds and returns the Uri of an asset, if any, else null.
Combines a number of folders and the specified filename.
NOTE: It searches the application assemblies too.
public static Uri FindUri(string FileName)
Parameters
FileNamestring
Returns
FindUri(string, string)
Finds and returns the Uri of an asset, if any, else null.
Combines a specified folder and filename.
NOTE: It searches the application assemblies too.
public static Uri FindUri(string Folder, string FileName)
Parameters
Returns
FindUri(string[], string)
Finds and returns the Uri of an asset, if any, else null.
Combines the specified folders and filename.
NOTE: It searches the application assemblies too.
public static Uri FindUri(string[] Folders, string FileName)
Parameters
Returns
FindUriByPath(string)
Returns true if an asset resource path exists, e.g. avares://Tripous.Desktop/Images/MyImage.png
public static Uri FindUriByPath(string AssetPath)
Parameters
AssetPathstring
Returns
SetImage(Image, string)
Sets the Avalonia.Controls.Image.Source of a specified image.
public static bool SetImage(Image Image, string FileName)
Parameters
ImageImageFileNamestring
Returns
SetImage(Image, Uri)
Sets the Avalonia.Controls.Image.Source of a specified image.
public static bool SetImage(Image Image, Uri Uri)
Parameters
ImageImageUriUri