Insert a Picture based on Cell Reference
Contents
[
Hide
]
Sometimes you have an empty picture and need to show data or contents in the picture by setting a cell reference in the Formula Bar. Aspose.Cells supports this feature (Microsoft Excel 2010).
Inserting a Picture Based on Cell Reference
Aspose.Cells supports displaying the contents of a worksheet cell in an image shape. You can link the picture to the cell that contains the data that you want to display. Since the cell or cell range is linked to the graphic object, changes to the data automatically appear in the graphic object. Add a picture to the worksheet by calling the addPicture method of the ShapeCollection collection (encapsulated in the Worksheet object). Specify the cell range by using the setFormula method of the Picture object.
Below is a screenshot of the file the code below generates.
Inserting a picture based on cell reference