回复 1楼menghuanyunxia的帖子
Winform版本吗?
参考如下代码:
- FarPoint.Win.Spread.CellType.ImageCellType icelltype = new FarPoint.Win.Spread.CellType.ImageCellType();
- icelltype.Style = FarPoint.Win.RenderStyle.Stretch;
- icelltype.TransparencyColor = Color.Black;
- icelltype.TransparencyTolerance = 100;
- fpSpread1.Sheets[0].Rows[0].CellType = icelltype;
- System.Drawing.Image image = System.Drawing.Image.FromFile(@"D:\_64.png");
- System.IO.MemoryStream stream = new System.IO.MemoryStream();
- byte[] bytes;
- string str;
- image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
- stream.Seek(0, System.IO.SeekOrigin.Begin);
- bytes = stream.GetBuffer();
- str = System.Convert.ToBase64String(bytes);
- fpSpread1.Sheets[0].Cells[0, 0].Value = image;
- fpSpread1.Sheets[0].Cells[0, 1].Value = bytes;
- fpSpread1.Sheets[0].Cells[0, 2].Value = str;
- fpSpread1.Sheets[0].ColumnHeader.Rows[0].Height = 300;
- fpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].CellType = icelltype;
- fpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Value = image;
复制代码
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > ImageCellType Class > ImageCellType Constructor : ImageCellType Constructor() |