如何让判断Image里面是否有图片 RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 根据src值转化成物理路径,用File.Exist(phyPath)来判断 image控件还是System.Drawing下的Image?? 我是直接用source取得bitmap类型的图片 <asp:Image ID="imgShow" runat="server" ImageUrl='<%#Eval("image") %>' Visible='<%#Eval("image") == x %>' />x 可能是 null, DbNull.Value, string.Empty,尝试一下,哪个适合你 我去。。呵呵。。都WPF了。。我各种猜还是没猜着。。 判断它的source为不为空?? if (image.ImageSource == null){ // do something.} 还用了wpf,我没接触过,你能给我说说wpf与你之前没用的编程有和优缺点吗 是image.source==null吧...貌似没啥效果..... 就是判断source是否为空啊....没效果... 1.从source转化成filepath,File.Exist(filepath)来判断,source我记得可以传入绝对路径也可以传入相对路径,所以需要判断后进行处理,这种方法比较直接也稍复杂些。2.判断它的width和height,如果有没有等于0的。曲线救国比较简单。 我还是把代码贴出来下吧 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不过貌似没啥实际效果 .判断它的width和height,如果有没有等于0的。曲线救国比较简单。...这倒可以试试 存储过程调用 C#问题 asp.net2005打包安装发布的问题. 高手进来帮帮忙啊!!!SOS C# SQL的问题 再问有关webform的多线程问题, 请welshem(天堂客) 再来,up者有分. c#中的简单问题?谢谢了哦! PropertyGrid 触发 PropertyValueChanged 的问题 请教关于OleDbCommand的问题 如何获取消息框的返回值??? vs2008 winform界面设计器无法使用 C# 如何获取 摄像头 设备ID 请教一个c#的套接字问题
image控件还是System.Drawing下的Image??
<asp:Image ID="imgShow" runat="server" ImageUrl='<%#Eval("image") %>' Visible='<%#Eval("image") == x %>' />x 可能是 null, DbNull.Value, string.Empty,尝试一下,哪个适合你
我去。。呵呵。。都WPF了。。我各种猜还是没猜着。。
判断它的source为不为空??
{
// do something.
}
还用了wpf,我没接触过,你能给我说说wpf与你之前没用的编程有和优缺点吗
2.判断它的width和height,如果有没有等于0的。曲线救国比较简单。
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不过貌似没啥实际效果