回复 11楼AllForAsking的帖子
AllForAsking 你好,
Spread 插入图片有两种方式:
1.插入图片可以通过插入 Shape ,设置背景图来插入图片:
- private void addShapeToolStripMenuItem_Click(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.DrawingSpace.RectangleShape rShape = new FarPoint.Win.Spread.DrawingSpace.RectangleShape();
- rShape.Name = "myRect1";
- rShape.Top = 20;
- rShape.Left = 60;
- rShape.Width = 100;
- rShape.Height = 100;
- rShape.BackgroundImage = new FarPoint.Win.Picture(Image.FromFile("123.png"));
- this.fpSpread1.Sheets[0].AddShape(rShape);
- }
复制代码
2.通过 ImageCellType 插入图片,这种方式是嵌入到单元格内部的:
- FarPoint.Win.Spread.CellType.ImageCellType imgType = new FarPoint.Win.Spread.CellType.ImageCellType();
- Image img = Image.FromFile("123.png");
- this.fpSpread1.Sheets[0].Cells[0, 0].CellType = imgType;
- this.fpSpread1.Sheets[0].Cells[0, 0].Value = img;
复制代码 |