Show / Hide Table of Contents

Class WpfUtils

Contains several UI tools for use in Windows Presentation Framework projects.

Inheritance
object
WpfUtils
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Helpers
Assembly: MCART.Wpf.Common.dll
Syntax
public static class WpfUtils

Methods

| Edit this page View Source

GetBitmap(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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX