Class WpfUtils
Contains several UI tools for use in Windows Presentation Framework projects.
Inherited Members
Namespace: TheXDS.MCART.Helpers
Assembly: MCART.Wpf.Common.dll
Syntax
public static class WpfUtils
Methods
| Edit this page View SourceGetBitmap(Stream?)
Creates a new BitmapImage from a Stream.
Declaration
public static BitmapImage? GetBitmap(Stream? stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream with the image content. |
Returns
| Type | Description |
|---|---|
| BitmapImage | A new BitmapImage created from the Stream. |
GetBitmap(string)
Obtains an image from a specified path.
Declaration
public static BitmapImage? GetBitmap(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Path to the image file. |
Returns
| Type | Description |
|---|---|
| BitmapImage | The image that has been read from the specified path. |
GetBitmap(Uri)
Obtains an image from a Uri.
Declaration
public static BitmapImage? GetBitmap(Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | uri | Uri with the image content. |
Returns
| Type | Description |
|---|---|
| BitmapImage | The image that has been read from the Uri. |
GetBitmapAsync(Uri)
Obtains an image from a Uri asynchronously.
Declaration
public static Task<BitmapImage?> GetBitmapAsync(Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | uri | Uri with the image content. |
Returns
| Type | Description |
|---|---|
| Task<BitmapImage> | The image that has been read from the Uri. |
GetBitmapEncoders()
Returns a collection of available bitmap encoders. Supports loading encoders from any loaded assembly.
Declaration
public static IEnumerable<BitmapEncoder> GetBitmapEncoders()
Returns
| Type | Description |
|---|---|
| IEnumerable<BitmapEncoder> | A list with a new instance of all available bitmap encoders. |
GetCircleArc(double, double, double, double)
Generates a circle arc that can be used in Windows Presentation Framework.
Declaration
public static PathGeometry GetCircleArc(double radius, double startAngle, double endAngle, double thickness)
Parameters
| Type | Name | Description |
|---|---|---|
| double | radius | Radius of the arc to generate. |
| double | startAngle | Initial angle of the arc. |
| double | endAngle | Final angle of the arc. |
| double | thickness | Thickness of the arc stroke. Helps balance the stroke thickness and radius to achieve a more consistent size. |
Returns
| Type | Description |
|---|---|
| PathGeometry | A PathGeometry that contains the arc generated by this function. |