mirror of
https://github.com/DarthAffe/HPPH.git
synced 2025-12-12 13:28:37 +00:00
21 lines
461 B
C#
21 lines
461 B
C#
using System.Drawing;
|
|
using System.Runtime.Versioning;
|
|
|
|
namespace HPPH.System.Drawing;
|
|
|
|
public static class ImageHelper
|
|
{
|
|
[SupportedOSPlatform("windows")]
|
|
public static IImage LoadImage(string path)
|
|
{
|
|
using Bitmap bmp = new(path);
|
|
return bmp.ToImage();
|
|
}
|
|
|
|
[SupportedOSPlatform("windows")]
|
|
public static IImage LoadImage(Stream stream)
|
|
{
|
|
using Bitmap bmp = new(stream);
|
|
return bmp.ToImage();
|
|
}
|
|
} |