找回密码
 立即注册

QQ登录

只需一步,快速开始

疯狂的爱豆

注册会员

2

主题

5

帖子

26

积分

注册会员

积分
26
最新发帖
疯狂的爱豆
注册会员   /  发表于:2018-1-15 11:10  /   查看:3147  /  回复:3
图片需要根据地址加载显示,请问要怎么实现?迷茫

3 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-1-16 09:44:59
沙发
地址是网络地址还是文件本地路径, 如果是网络图片可以先下载再显示,本地路径的图片,只要设置好相对或者绝对位置就可以了。
您发帖时候要发到对应产品的板块,这样处理更及时
回复 使用道具 举报
疯狂的爱豆
注册会员   /  发表于:2018-1-16 21:06:14
板凳
地址是内网的共享路径,把路径赋值给列就能显示吗?不需要将列设置为图片控件吗?另外我也想发到对应的板块,但是提示我不能发言
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-1-17 09:21:53
地板
可以参考下下面的代码。
  1. public class ImageCellFactory : CellFactory
  2.     {
  3.         public override void CreateCellContent(C1FlexGrid grid, System.Windows.Controls.Border bdr, CellRange rng)
  4.         {
  5.             base.CreateCellContent(grid, bdr, rng);
  6.             if ((rng.Row == 1) && (rng.Column == 1))
  7.             {
  8.                 var image = new Image();
  9.                 BitmapImage src = new BitmapImage(new Uri("../../myimage.png"));
  10.                 image.Source = src;
  11.                 bdr.Child = image;
  12.                 image.MouseLeftButtonDown += (s, e) =>
  13.                     {
  14.                        //do work here
  15.                     };
  16.             }
  17.   }
  18. }

  19. flex.CellFactory=new ImageCellFactory();
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部