mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-04 16:10:16 -04:00
23 lines
528 B
C#
23 lines
528 B
C#
|
using System.IO;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using Splat;
|
|||
|
|
|||
|
namespace ModernKeePassLib.Utility
|
|||
|
{
|
|||
|
public class GfxUtil
|
|||
|
{
|
|||
|
public static async Task<IBitmap> LoadImage(byte[] pb)
|
|||
|
{
|
|||
|
return await ScaleImage(pb, null, null);
|
|||
|
}
|
|||
|
|
|||
|
public static async Task<IBitmap> ScaleImage(byte[] pb, int? w, int? h)
|
|||
|
{
|
|||
|
using (var ms = new MemoryStream(pb, false))
|
|||
|
{
|
|||
|
return await BitmapLoader.Current.Load(ms, w, h);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|