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 位图编程相关推荐

  1. Windows GDI和GDI+编程实例剖析(1)

    Windows GDI和GDI+编程实例剖析(1) 作者:宋宝华  e-mail:21cnbao@21cn.com 1.基本概念 GDI在Windows中定义为Graphics Device Inte ...

  2. Windows环境下Unicode编程总结和将ANSI转换到Unicode 将Unicode转换到ANSI

    Windows环境下Unicode编程总结 UNICODE环境设置 在安装Visual Studio时,在选择VC++时需要加入unicode选项,保证相关的库文件可以拷贝到system32下. UN ...

  3. Windows客户端C/C++编程规范“建议”——前言

    前言 工作中接触了很多编程规范.其中最有意思的是,公司最近发布了一版C/C++编程规范,然后我看到该规范的最后一段时,有这么一句:"该规范不适用于Windows平台开发".看来这份 ...

  4. windows环境下unicode编程总结

    windows环境下unicode编程总结 UNICODE环境设置 在安装Visual Studio时,在选择VC++时需要加入unicode选项,保证相关的库文件可以拷贝到system32下. UN ...

  5. Windows 上的网络通信编程

    1. 关于 Servers 和 Clients 有两种不同类型的套接字网络应用程序:服务器和客户端. 服务器和客户端的行为不同:因此,创建它们的流程也是不一样的.以下是用于创建流式 TCP/IP 服务 ...

  6. MFC—windows套接字编程

    Windows 套接字编程 一.常见概念 1.Windows Sockets 规范 Windows Sockets 规范是 Windows 平台下定义的可以兼容二进制数据传输的网络编程接口,是基于伯克 ...

  7. windows批处理 (cmd/bat) 编程详解

    2019独角兽企业重金招聘Python工程师标准>>> windows批处理 (cmd/bat) 编程详解 开始之前先简单说明下cmd文件和bat文件的区别:在本质上两者没有区别,都 ...

  8. (6)Windows下的网络编程

    目录索引 Windows下的网络编程 接口分析 编程差异 编程示例 多路复用 Windows下的网络编程 接口分析 Windows下的socket编程接口与Linux中几乎相同: 不同之处: – 返回 ...

  9. Windows下的网络编程Winsock

    文章目录 前言 1.服务器下的Winsock 1.1.构建编程环境: 1.2.WSAData结构体 1.3.WSAStartup初始化Winsock 1.4.WSACleanup释放Winsock 1 ...

最新文章

  1. DB2存储过程——条件判断语句if then
  2. 软件工程实践2017 结队项目——第二次作业
  3. Java并发学习之玩转线程池
  4. toString()与new String ()用法区别
  5. Linux 内核的同步方式
  6. BZOJ3527: [Zjoi2014]力
  7. Android ViewPager
  8. Vagrant搭建可移动的PHP开发环境
  9. linux在python的虚拟环境下运行程序_在win10和linux上分别安装Python虚拟环境的方法步骤...
  10. 转载div+css布局教程之div+css常见布局结构定义
  11. ios微信上无法自动播放音频的情况
  12. deep learning 学习资料
  13. CSDN获得积分的方法
  14. 基于mfc 组态软件_仪表人零基础学系统组态,必备知识!
  15. 解决gradle运行gradle -v命令报Fialed to laod library 'native-platform.dll'错误
  16. 广告行业中富媒体的概念
  17. 天兔(Lepus)监控操作系统(OS)安装配置
  18. rac集群状态中监听状态CHECK TIMED OUT处理
  19. SQL2008服务器连接失败
  20. Lance老师UI系列教程第三课-QQ登录注册界面的实现(android-2012最新版)

热门文章

  1. 理解JSON.stringify()高级用法
  2. redis的bitset实战
  3. Git私服搭建与使用
  4. Cookie 和 Session的区别
  5. Spring Boot 13 之freemarker
  6. 进程守护系统,你懂吗?
  7. nginx+tomcat动静分离结构
  8. 难死金庸的考题(高中难度)
  9. python ini文件操作
  10. OpenCV 图像缩放