Pilz.UI: convert to C#
This commit is contained in:
13
Pilz.UI/Extensions.cs
Normal file
13
Pilz.UI/Extensions.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace Pilz.UI;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static Image? ToIcon(this Image image)
|
||||
{
|
||||
if (image is Bitmap bmp)
|
||||
return Icon.FromHandle(bmp.GetHicon());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user