本文介绍了在模拟器中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此代码

i have this code

void StartReceiving()
{
byte[] response = new byte[131072];
SocketAsyncEventArgs socketEventArg = new SocketAsyncEventArgs();
socketEventArg.Completed += OnReceiveCompleted;
socketEventArg.SetBuffer(response, 0, response.Length);
client_socket.ReceiveAsync(socketEventArg);
}

private void ViewReceivedImage(byte[] buffer)

{ try { MemoryStream ms = new MemoryStream(buffer);

BitmapImage bi = new BitmapImage();

bi.SetSource(ms); MyImage.Source = bi;

ms.Close();

}

catch (Exception) { }

finally { StartReceiving();

} }


wp7中的这段代码将字节数组转换为图像
我的问题
我想在wp7模拟器中显示此图像,我该怎么做
在主页.xaml中需要编写什么代码?
提前thnx


this code in wp7 convert byte array to image
my question
i want to display this image in wp7 emulator how i can do it
what code need to write in mainpage .xaml ?
thnx in advance

推荐答案


这篇关于在模拟器中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 22:41