RT

解决方案 »

  1.   

    根据src值转化成物理路径,用File.Exist(phyPath)来判断
      

  2.   


    image控件还是System.Drawing下的Image??
      

  3.   

    我是直接用source取得bitmap类型的图片
      

  4.   


    <asp:Image ID="imgShow" runat="server" ImageUrl='<%#Eval("image") %>' Visible='<%#Eval("image") == x %>' />x 可能是 null, DbNull.Value, string.Empty,尝试一下,哪个适合你
      

  5.   


    我去。。呵呵。。都WPF了。。我各种猜还是没猜着。。
      

  6.   


    判断它的source为不为空??
      

  7.   

    if (image.ImageSource == null)
    {
        // do something.
    }
      

  8.   


    还用了wpf,我没接触过,你能给我说说wpf与你之前没用的编程有和优缺点吗
      

  9.   

    是image.source==null吧...貌似没啥效果.....
      

  10.   

    就是判断source是否为空啊....没效果...
      

  11.   

    1.从source转化成filepath,File.Exist(filepath)来判断,source我记得可以传入绝对路径也可以传入相对路径,所以需要判断后进行处理,这种方法比较直接也稍复杂些。
    2.判断它的width和height,如果有没有等于0的。曲线救国比较简单。
      

  12.   

    我还是把代码贴出来下吧                       Screenshots s = new Screenshots();
                           Image im = new Image();
                           BitmapImage img = new BitmapImage();
                           img.BeginInit();
                           img.StreamSource = s.GetScreenshots();
                           img.EndInit();
                           im.Source = img;
                           curContext.Post(delegate
                               {
                                   Image image = new Image();
                                   if (image.Source != null)
                                   {
                                       image.Source = null; 
                                   }
                                   image.Source = img;
                                   myViewGrid.Children.Add(image);
                               }, null);0.0我现在是用的image.source!=null不过貌似没啥实际效果
      

  13.   

    .判断它的width和height,如果有没有等于0的。曲线救国比较简单。...这倒可以试试