当前位置: 首页>>代码示例>>C#>>正文


C# BitmapImage.set_UriSource方法代码示例

本文整理汇总了C#中System.Windows.Media.Imaging.BitmapImage.set_UriSource方法的典型用法代码示例。如果您正苦于以下问题:C# BitmapImage.set_UriSource方法的具体用法?C# BitmapImage.set_UriSource怎么用?C# BitmapImage.set_UriSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Media.Imaging.BitmapImage的用法示例。


在下文中一共展示了BitmapImage.set_UriSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Convert

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return null;
            }
            BitmapImage image = new BitmapImage();
            switch (((QualityFace) value))
            {
                case QualityFace.NoData:
                    return null;

                case QualityFace.Happy:
                    image.set_UriSource(new Uri("/BEPB;component/Images/Popup/HappyFace.png", UriKind.Relative));
                    return image;

                case QualityFace.Normal:
                    image.set_UriSource(new Uri("/BEPB;component/Images/Popup/NormalFace.png", UriKind.Relative));
                    return image;

                case QualityFace.Sad:
                    image.set_UriSource(new Uri("/BEPB;component/Images/Popup/SadFace.png", UriKind.Relative));
                    return image;
            }
            return image;
        }
开发者ID:guazipi,项目名称:bjAirPollution,代码行数:26,代码来源:QualityFaceConverter.cs

示例2: Image_MouseLeftButtonDown

 private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     Image image = sender as Image;
     if (image != null)
     {
         if ((!string.IsNullOrEmpty(this.CurrentChannelName) && (this.CurrentChannelName != image.get_Name())) && ((image.get_Name() != "Support") && (image.get_Name() != "Mobile")))
         {
             BitmapImage image2 = new BitmapImage();
             string currentChannelName = this.CurrentChannelName;
             if (currentChannelName != null)
             {
                 if (!(currentChannelName == "Actually"))
                 {
                     if (currentChannelName == "Quality")
                     {
                         image2.set_UriSource(new Uri("/BEPB;component/Images/AQI.png", UriKind.Relative));
                         this.Quality.set_Source(image2);
                     }
                     else if (currentChannelName == "Forecast")
                     {
                         image2.set_UriSource(new Uri("/BEPB;component/Images/fqyb.png", UriKind.Relative));
                         this.Forecast.set_Source(image2);
                     }
                 }
                 else
                 {
                     image2.set_UriSource(new Uri("/BEPB;component/Images/ssnd.png", UriKind.Relative));
                     this.Actually.set_Source(image2);
                 }
             }
             this.CurrentChannelName = image.get_Name();
         }
         if (this.LastStation != null)
         {
             this.LastStation.IsFocused = false;
         }
         string str2 = image.get_Name();
         if (str2 != null)
         {
             if (!(str2 == "Actually"))
             {
                 if (!(str2 == "Quality"))
                 {
                     if (!(str2 == "Forecast"))
                     {
                         if (!(str2 == "Support"))
                         {
                             if (str2 == "Mobile")
                             {
                                 HtmlPage.get_Window().Navigate(new Uri("http://www.bjmemc.com.cn/g377.aspx", UriKind.Absolute), "_blank");
                             }
                             return;
                         }
                         HtmlPage.get_Window().Navigate(new Uri("http://www.bjmemc.com.cn/g370.aspx", UriKind.Absolute), "_blank");
                         return;
                     }
                     this.DayForecastPanel.set_Visibility(0);
                     this.ActuallyFrame.set_Visibility(1);
                     this.AirQualityFrame.set_Visibility(1);
                     this.bsMapMode.ZoomHome(true);
                     this.bsMapMode.bCanZoom = false;
                     this.airDataContext.bCanZoomIn = false;
                     this.airDataContext.bCanZoomOut = false;
                     this.NavigationCtrl.bCanZoom = false;
                     this.Five.set_Visibility(0);
                     this.Districts.set_Visibility(1);
                     this.MapStations.set_Visibility(1);
                     this.p_bottom_aqiGrid.set_Visibility(1);
                     this.wrwtlGrid.set_Visibility(1);
                     return;
                 }
             }
             else
             {
                 this.DayForecastPanel.set_Visibility(1);
                 this.ActuallyFrame.set_Visibility(0);
                 this.AirQualityFrame.set_Visibility(1);
                 this.bsMapMode.bCanZoom = true;
                 this.airDataContext.bCanZoomIn = this.bsMapMode.bCanZoomIn;
                 this.airDataContext.bCanZoomOut = this.bsMapMode.bCanZoomOut;
                 this.NavigationCtrl.bCanZoom = true;
                 this.wrwButtonsBorder.set_Visibility(0);
                 if (this.WRWChannelClicked == 0)
                 {
                     this.WRWChannelClicked = 1;
                 }
                 if ((this.WRWChannelClicked == 1) && this.bWRWDataLoaded)
                 {
                     this.wrw_pm25.set_Visibility(0);
                     (this.wrwButtons.get_Resources().get_Item("PM25Storyboard") as Storyboard).Begin();
                     this.WRWChannelClicked = -1;
                 }
                 foreach (StationData data in (Application.get_Current() as App).StationsList)
                 {
                     StationPushpin station = this.GetStation(data.Station);
                     if (station != null)
                     {
                         station.set_Background(data.WRWBackColor);
                         station.DataVisibility = data.WRWDataVisibility;
                     }
//.........这里部分代码省略.........
开发者ID:guazipi,项目名称:bjAirPollution,代码行数:101,代码来源:MainPage.cs

示例3: Image_MouseLeave

 private void Image_MouseLeave(object sender, MouseEventArgs e)
 {
     Image image = sender as Image;
     if ((image != null) && (string.IsNullOrEmpty(this.CurrentChannelName) || (this.CurrentChannelName != image.get_Name())))
     {
         BitmapImage image2 = new BitmapImage();
         string str = image.get_Name();
         if (str != null)
         {
             if (!(str == "Actually"))
             {
                 if (str == "Quality")
                 {
                     image2.set_UriSource(new Uri("/BEPB;component/Images/AQI.png", UriKind.Relative));
                 }
                 else if (str == "Forecast")
                 {
                     image2.set_UriSource(new Uri("/BEPB;component/Images/fqyb.png", UriKind.Relative));
                 }
                 else if (str == "Support")
                 {
                     image2.set_UriSource(new Uri("/BEPB;component/Images/fwzc.png", UriKind.Relative));
                 }
                 else if (str == "Mobile")
                 {
                     image2.set_UriSource(new Uri("/BEPB;component/Images/sjb.png", UriKind.Relative));
                 }
             }
             else
             {
                 image2.set_UriSource(new Uri("/BEPB;component/Images/ssnd.png", UriKind.Relative));
             }
         }
         image.set_Source(image2);
     }
 }
开发者ID:guazipi,项目名称:bjAirPollution,代码行数:36,代码来源:MainPage.cs


注:本文中的System.Windows.Media.Imaging.BitmapImage.set_UriSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。