public BitmapImage ReadBitmapFromFile(string path)
{
byte[] img_bytes = File.ReadAllBytes(path);
MemoryStream ms = new MemoryStream(img_bytes, 0, img_bytes.Length);
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.StreamSource = ms;
bitmap.CacheOption = BitmapCacheOption.Default;
bitmap.CreateOptions = BitmapCreateOptions.None;
RenderOptions.SetBitmapScalingMode(bitmap, BitmapScalingMode.HighQuality);
bitmap.EndInit();
bitmap.Freeze();
return bitmap;
}