在模拟器中显示图像 [英] display image in emulator
本文介绍了在模拟器中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有此代码
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
推荐答案
嗯,它是Windows Phone的仿真器,您不需要在代码中进行任何更改.无论将部署到真实电话上运行的什么内容,都将部署到仿真器.它的工作方式相同.
您需要设置的任何通信,例如将电话"连接到网络,都是在模拟器配置中完成的,而不是您的代码.
Uhhh, it''s an emulator for a Windows Phone, you don''t need to change anything at all in your code. Whatever you would deploy to a real phone to run, you deploy to the emulator. It works the same way.
Any communication that you need to setup, like attaching the "phone" to a network, you do in the emulator configuration, not your code.
这篇关于在模拟器中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文