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;


    }
    }

  • 相关阅读:
    GDI+小例子
    GDI & GDI+
    GDI绘图中的映射模式CDC::SetMapMode()
    Socket心跳包机制
    Winpcap网络开发库入门
    AdjustTokenPrivileges启用权限
    SetLocalTime设置本地时间
    UDP收/发广播包原理及步骤
    如何使用UDP进行跨网段广播
    Windows关机过程分析与快速关机
  • 原文地址:https://www.cnblogs.com/meimao5211/p/3448840.html
Copyright © 2011-2022 走看看