26 lines
847 B
C#
26 lines
847 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Sarand.Net.Mobile.Maui.Utils
|
|
{
|
|
//=======================================================================
|
|
public static class SamImageUtil
|
|
{
|
|
//-------------------------------------------------------------------
|
|
/// <summary>
|
|
/// Method that uses the ImageConverter object in .Net Framework to convert a byte array,
|
|
/// presumably containing a JPEG or PNG file image, into an ImageSource.
|
|
/// </summary>
|
|
public static ImageSource GetImageFromByteArray(byte[] imageAsBytes)
|
|
{
|
|
return ImageSource.FromStream(() => new MemoryStream(imageAsBytes));
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|