mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
cleanup necessary namespaces and adjust namespaces for certain classes to better represent what they're for models, helpers and tools are all different and shouldnt really be under the same namespace
20 lines
562 B
C#
20 lines
562 B
C#
using System.Drawing;
|
|
using System.IO;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Media;
|
|
|
|
namespace Bloxstrap.Extensions
|
|
{
|
|
public static class IconEx
|
|
{
|
|
public static Icon GetSized(this Icon icon, int width, int height) => new(icon, new Size(width, height));
|
|
|
|
public static ImageSource GetImageSource(this Icon icon)
|
|
{
|
|
using MemoryStream stream = new();
|
|
icon.Save(stream);
|
|
return BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
|
|
}
|
|
}
|
|
}
|