Use the IXlPicture.SetOneCellAnchor method to anchor the picture’s top-left corner to a worksheet cell. The picture does not move or resize with the underlying cells. The position is defined by offsets from the worksheet’s left and top edges to the picture’s top-left corner. Use the IXlPicture.SetAbsoluteAnchor method to specify the absolute picture position in the worksheet. To position the picture in the worksheet, use one of the following methods depending on the anchor type you wish to use: Use the Image.FromFile or Image.FromStream method to load the required image from a file or data stream. Call the IXlPicture.SetImage method to specify the image you wish to display in the worksheet. Call the IXlSheet.CreatePicture method to create a new IXlPicture object.The IXlPicture interface contains properties and methods that allow you to load a picture from a file or stream, specify picture position, and add a hyperlink to the picture.įollow the steps below to add a picture to a worksheet: This topic describes how to use the Excel Export Library to insert a picture into a worksheet. Use the Excel Export API to Insert and Position a Picture in a Worksheet
0 Comments
Leave a Reply. |