Windows Phone 7 位图编程
Image控件的写法
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Image Name="img" />
</Grid>
通过System.Windows.Controls.Control.ManipulationStarted事件来进行调用这这个方法覆盖了System.Windows.UIElement.OnManipulationStarted(System.Windows.Input.ManipulationStartedEventArgs)。
加载网络的图片资源
protected override void OnManipulationStarted(ManipulationStartedEventArgs args)
{
Uri uri = new Uri("http://www.website.com/image/a.jpg");
BitmapImage bmp = new BitmapImage(uri);
img.Source = bmp;
args.Complete();
args.Handled = true;
base.OnManipulationStarted(args);
}
加载本地的图片资源
protected override void OnManipulationStarted(ManipulationStartedEventArgs args)
{
Uri uri = new Uri("../Images/Hello.png", UriKind.Relative);
StreamResourceInfo resourceInfo = Application.GetResourceStream(uri);
BitmapImage bmp = new BitmapImage();
bmp.SetSource(resourceInfo.Stream);
img.Source = bmp;
args.Complete();
args.Handled = true;
base.OnManipulationStarted(args);
}
窗体顶端
本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1079238
Windows Phone 7 位图编程相关推荐
- Windows GDI和GDI+编程实例剖析(1)
Windows GDI和GDI+编程实例剖析(1) 作者:宋宝华 e-mail:21cnbao@21cn.com 1.基本概念 GDI在Windows中定义为Graphics Device Inte ...
- Windows环境下Unicode编程总结和将ANSI转换到Unicode 将Unicode转换到ANSI
Windows环境下Unicode编程总结 UNICODE环境设置 在安装Visual Studio时,在选择VC++时需要加入unicode选项,保证相关的库文件可以拷贝到system32下. UN ...
- Windows客户端C/C++编程规范“建议”——前言
前言 工作中接触了很多编程规范.其中最有意思的是,公司最近发布了一版C/C++编程规范,然后我看到该规范的最后一段时,有这么一句:"该规范不适用于Windows平台开发".看来这份 ...
- windows环境下unicode编程总结
windows环境下unicode编程总结 UNICODE环境设置 在安装Visual Studio时,在选择VC++时需要加入unicode选项,保证相关的库文件可以拷贝到system32下. UN ...
- Windows 上的网络通信编程
1. 关于 Servers 和 Clients 有两种不同类型的套接字网络应用程序:服务器和客户端. 服务器和客户端的行为不同:因此,创建它们的流程也是不一样的.以下是用于创建流式 TCP/IP 服务 ...
- MFC—windows套接字编程
Windows 套接字编程 一.常见概念 1.Windows Sockets 规范 Windows Sockets 规范是 Windows 平台下定义的可以兼容二进制数据传输的网络编程接口,是基于伯克 ...
- windows批处理 (cmd/bat) 编程详解
2019独角兽企业重金招聘Python工程师标准>>> windows批处理 (cmd/bat) 编程详解 开始之前先简单说明下cmd文件和bat文件的区别:在本质上两者没有区别,都 ...
- (6)Windows下的网络编程
目录索引 Windows下的网络编程 接口分析 编程差异 编程示例 多路复用 Windows下的网络编程 接口分析 Windows下的socket编程接口与Linux中几乎相同: 不同之处: – 返回 ...
- Windows下的网络编程Winsock
文章目录 前言 1.服务器下的Winsock 1.1.构建编程环境: 1.2.WSAData结构体 1.3.WSAStartup初始化Winsock 1.4.WSACleanup释放Winsock 1 ...
最新文章
- DB2存储过程——条件判断语句if then
- 软件工程实践2017 结队项目——第二次作业
- Java并发学习之玩转线程池
- toString()与new String ()用法区别
- Linux 内核的同步方式
- BZOJ3527: [Zjoi2014]力
- Android ViewPager
- Vagrant搭建可移动的PHP开发环境
- linux在python的虚拟环境下运行程序_在win10和linux上分别安装Python虚拟环境的方法步骤...
- 转载div+css布局教程之div+css常见布局结构定义
- ios微信上无法自动播放音频的情况
- deep learning 学习资料
- CSDN获得积分的方法
- 基于mfc 组态软件_仪表人零基础学系统组态,必备知识!
- 解决gradle运行gradle -v命令报Fialed to laod library 'native-platform.dll'错误
- 广告行业中富媒体的概念
- 天兔(Lepus)监控操作系统(OS)安装配置
- rac集群状态中监听状态CHECK TIMED OUT处理
- SQL2008服务器连接失败
- Lance老师UI系列教程第三课-QQ登录注册界面的实现(android-2012最新版)