您好,shape设置name然后用name remove掉
或者clear掉所有的
公章签名您是图片的话放到 RectangleShape 里。
如果您签名的位置是固定在单元格里的话也可以用ImageCellType
- FarPoint.Win.Spread.DrawingSpace.EllipseShape b = new FarPoint.Win.Spread.DrawingSpace.EllipseShape();
- b.Size = new Size(200, 200);
- b.Name = "Ellipse1";
- fpSpread2.ActiveSheet.AddShape(b, 2, 2, 10, 10, false);
- fpSpread2.ActiveSheet.RemoveShape("Ellipse1");
- fpSpread2.ActiveSheet.ClearShapes();
-
- FarPoint.Win.Spread.DrawingSpace.RectangleShape rShape = new FarPoint.Win.Spread.DrawingSpace.RectangleShape();
- rShape.BackColor = Color.Transparent;
- rShape.Picture= Image.FromFile("googlelogo_color_120x44dp.png");
- fpSpread2.ActiveSheet.AddShape(rShape, 2, 2);
复制代码
- 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:\\alphaomega3.jpg");
- 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;
复制代码 |