Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
725
Image in a cell
posted

I'm working with Infragistics3.Documents.Excel.v11.1 (version 11.1.20111.2009)

How can I insert the image of one file in a cell?

Thank you in advance for your response.

Parents
  • 44743
    posted

    Images cannot really be added to cells, as they are added as a layer on top of the worksheet, like all shapes. You can, however, place an image directly over a cell and have it move and size with the cell to give it the appearance of being in the cell.

    Create a WorksheetImage instance, giving it the Image you want displayed. Use the SetBoundsInTwips method to set the image bounds to the bounds of the cell. You can get the cell's bounds by calling GetBoundsInTwips on the WorksheetCell instance for the cell. Then add the WorksheetImage to the Worksheet.Shapes collection. Also, set the WorksheetImage.PositioningMode to MoveAndSizeWithCells.

Reply Children