public XSSFPicture CreatePicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = this.GetDrawing().AddPictureReference(pictureIndex); CT_Picture ctPicture = this.ctGroup.AddNewPic(); ctPicture.Set(XSSFPicture.Prototype()); XSSFPicture xssfPicture = new XSSFPicture(this.GetDrawing(), ctPicture); xssfPicture.parent = this; xssfPicture.anchor = (XSSFAnchor)anchor; xssfPicture.SetPictureReference(rel); return(xssfPicture); }
public IPicture CreatePicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = this.AddPictureReference(pictureIndex); long num = this.newShapeId(); CT_Picture ctPicture = this.CreateTwoCellAnchor((IClientAnchor)anchor).AddNewPic(); ctPicture.Set(XSSFPicture.Prototype()); ctPicture.nvPicPr.cNvPr.id = (uint)num; XSSFPicture xssfPicture = new XSSFPicture(this, ctPicture); xssfPicture.anchor = (XSSFAnchor)anchor; xssfPicture.SetPictureReference(rel); return((IPicture)xssfPicture); }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link XSSFWorkbook#getAllPictures()} . * @return the newly Created picture shape. */ public XSSFPicture CreatePicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = GetDrawing().AddPictureReference(pictureIndex); CT_Picture ctShape = ctGroup.AddNewPic(); ctShape.Set(XSSFPicture.Prototype()); XSSFPicture shape = new XSSFPicture(GetDrawing(), ctShape); shape.parent = this; shape.anchor = anchor; shape.SetPictureReference(rel); return(shape); }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link NPOI.xssf.usermodel.XSSFWorkbook#getAllPictures()} . * * @return the newly Created picture shape. */ public IPicture CreatePicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = AddPictureReference(pictureIndex); long shapeId = newShapeId(); CT_TwoCellAnchor ctAnchor = CreateTwoCellAnchor(anchor); NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_Picture ctShape = ctAnchor.AddNewPic(); ctShape.Set(XSSFPicture.Prototype()); ctShape.nvPicPr.cNvPr.id = (uint)shapeId; XSSFPicture shape = new XSSFPicture(this, ctShape); shape.anchor = anchor; shape.SetPictureReference(rel); return(shape); }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link NPOI.xssf.usermodel.XSSFWorkbook#getAllPictures()} . * * @return the newly Created picture shape. */ public IPicture CreatePicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = AddPictureReference(pictureIndex); long shapeId = newShapeId(); CT_TwoCellAnchor ctAnchor = CreateTwoCellAnchor(anchor); CT_Picture ctShape = ctAnchor.AddNewPic(); ctShape.Set(XSSFPicture.Prototype()); ctShape.nvPicPr.cNvPr.id = (uint)shapeId; ctShape.nvPicPr.cNvPr.name = "Picture " + shapeId; XSSFPicture shape = new XSSFPicture(this, ctShape); shape.anchor = anchor; shape.SetPictureReference(rel); return shape; }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link XSSFWorkbook#getAllPictures()} . * @return the newly Created picture shape. */ public XSSFPicture CreatePicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = GetDrawing().AddPictureReference(pictureIndex); CT_Picture ctShape = ctGroup.AddNewPic(); ctShape.Set(XSSFPicture.Prototype()); XSSFPicture shape = new XSSFPicture(GetDrawing(), ctShape); shape.parent = this; shape.anchor = anchor; shape.SetPictureReference(rel); return shape; }