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;


    }
    }

  • 相关阅读:
    Notes 20180308 : 语句
    Knowledge Point 20180308 拔下forEach的外衣
    Notes 20180307 : 运算符
    Notes 20180306 : 变量与常量
    Knowledge Point 20180305 Java程序员详述编码Unicode
    Knowledge Point 20180305 十进制转换成二进制浮点数
    Knowledge Point 20180305 补位的两种方式
    老式浏览器支持html5与css3
    浏览器内核总结
    koa常用api文档整理
  • 原文地址:https://www.cnblogs.com/meimao5211/p/3448840.html
Copyright © 2011-2022 走看看