zoukankan      html  css  js  c++  java
  • silverlight 图片引入代码

    private void comboBox2_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
    string str = this.comboBox2.SelectedIndex.ToString() ;
    //MessageBox.Show(str);

    //if (str == "1")
    if (str.Equals("1"))
    {
    //Image myImage3 = new Image();
    //BitmapImage bi3 = new BitmapImage();
    ////bi3.BeginInit();
    //bi3.UriSource = new Uri("../Image2/19guolvsheshi.png", UriKind.Relative);
    ////bi3.EndInit();
    //myImage3.Stretch = Stretch.Fill;
    //myImage3.Source = bi3;
    //this.image2 = myImage3;

    MessageBox.Show(str+"if");
    //Image myImage3 = new Image();
    BitmapImage bi3 = new BitmapImage();
    //bi3.BeginInit();
    bi3.UriSource = new Uri("../../../Image2/20guolvsheshi.png", UriKind.RelativeOrAbsolute);
    //bi3.EndInit();
    //myImage3.Stretch = Stretch.Fill;
    //myImage3.Source = bi3;
    //this.image2 = myImage3;

    //this.image2 = new Image();
    image2.Stretch = Stretch.Fill;
    //image2.Source = bi3;
    this.image2.Source = bi3;
    }
    else {
    ////Image myImage3 = new Image();
    //BitmapImage bi3 = new BitmapImage();
    ////bi3.BeginInit();
    //bi3.UriSource = new Uri("/Image2/20guolvsheshi.png", UriKind.RelativeOrAbsolute);
    ////bi3.EndInit();
    ////myImage3.Stretch = Stretch.Fill;
    ////myImage3.Source = bi3;
    ////this.image2 = myImage3;

    MessageBox.Show(str + "else");
    BitmapImage bi3 = new BitmapImage();
    bi3.UriSource = new Uri("../Image2/20guolvsheshi.png", UriKind.RelativeOrAbsolute);
    //this.image1 = new Image();
    //image1.Stretch = Stretch.Fill;
    image1.Source = bi3;


    }
    }

  • 相关阅读:
    CSAcademy Or Problem
    BZOJ 4516 [Sdoi2016] 生成魔咒
    SPOJ7258 SUBLEX
    SPOJ1812 LCS2
    SPOJ1811 LCS
    SPOJ8222 NSUBSTR
    洛谷3804 【模板】后缀自动机
    SPOJ287 NETADMIN
    SPOJ1693 COCONUTS
    BZOJ5329 SDOI2018 战略游戏
  • 原文地址:https://www.cnblogs.com/meimao5211/p/3448840.html
Copyright © 2011-2022 走看看