zoukankan      html  css  js  c++  java
  • windows phone 学习笔记 四

    设置应用程序的背景图片:
    private void image1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
            {
                SetAppBackground("/ChangeBackground;component/Images/Lighthouse.png");
            }
    
            private static void SetAppBackground(string imageName)
            {
                var app = Application.Current as App;
                if (app == null)
                    return;
    
                var imageBrush = new ImageBrush
                {
                    ImageSource = new BitmapImage(new Uri(imageName, UriKind.Relative))
                };
                app.RootFrame.Background = imageBrush;
            }
    
            private void image2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
            {
                SetAppBackground("/ChangeBackground;component/Images/Tulips.jpg");
            }

    a   b

  • 相关阅读:
    Python编程四大神兽:迭代器、生成器、闭包和装饰器
    Linux基础
    3.8记录
    3.7记录
    3.6进度记录
    3.5进度
    3.4进度
    3.3进度
    3.2进度记录
    3.1记录
  • 原文地址:https://www.cnblogs.com/caodaiming/p/2291669.html
Copyright © 2011-2022 走看看