finally i found the answer
byte[] b;
b = System.IO.File.ReadAllBytes(openfile.FileName);
MemoryStream byteStream = new MemoryStream(b);
BitmapImage image = new BitmapImage();
image.BeginInit();
image.StreamSource = byteStream;
image.EndInit();
image1.Source = image;