zoukankan      html  css  js  c++  java
  • 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);

            }

    窗体顶端

  • 相关阅读:
    【PHP】php重写session的存储机制
    【Javascript】原生js 全特效微博发布面板效果实现
    【Javascript】原生js百叶窗效果的实现及原理介绍
    【jQuery】jquery全屏滚动插件【fullPage.js】API 使用方法总结
    从百度音乐和酷狗音乐的分类想到的
    jQuer __Ajax DOM
    面向对象闭包 继承
    Git
    设计模式
    html5标签大全
  • 原文地址:https://www.cnblogs.com/linzheng/p/1948060.html
Copyright © 2011-2022 走看看