XMAL部分:直接拖一个Image控件到窗口上
<Image Name="Image1" HorizontalAlignment="Left" Height="242" Width="192" VerticalAlignment="Top" />
---------------------------------------------------------------------------------------
private BitmapSource show_16grayImage()
{
string imgPath = @"D:\tmp\1024X1024X16bits.raw";
FileStream fileStream = File.OpenRead(imgPath);
byte[] bytes = new byte[1024 * 1024 * 2];
fileStream.Read(bytes, 0, 1024 * 1024 * 2);
BitmapImage bmp = new BitmapImage();
fileStream.Close();
return BitmapSource.Create(1024, 1024, 96,