BitmapImage to byte[]
Posted: Thu Feb 07, 2019 12:01 am
Is there a solution for converting BitmapImage to byte array? (or any equivalent)
Image will be from Image.Source.
The purpose is to send the image to WCF Service
I've got the code for converting byte[] to BitmapImage
Thank you.
Image will be from Image.Source.
The purpose is to send the image to WCF Service
I've got the code for converting byte[] to BitmapImage
Code: Select all
public static BitmapImage byteArrayToImage(byte[] byteArrayIn)
{
BitmapImage bmi = new BitmapImage();
MemoryStream ms = new MemoryStream(byteArrayIn);
bmi.SetSource(ms);
return bmi;
}
Thank you.