officefileapi-120747-spreadsheet-document-api-examples-pictures-how-to-add-a-hyperlink-to-a-picture.md
This example describes how to associate a hyperlink with a picture using the following API.
| Member | Description |
|---|---|
| PictureCollection.AddPicture | Inserts a picture from a file or a SpreadsheetImageSource object to fit in the specified range. |
| Shape.InsertHyperlink | Creates a new ShapeHyperlink object with the passed hyperlink destination. The hyperlink can refer to a web page, existing file or directory, e-mail address or cell range. |
| HyperlinkBase.TooltipText | Specifies the hyperlink’s tooltip.This text is displayed when the cursor hovers over the picture. |
The following code snippet inserts a picture and attaches a hyperlink to it:
Workbook workbook = new Workbook();
Picture picture = workbook.Worksheets[0].Pictures.AddPicture("DevExpress.png", workbook.Worksheets[0].Cells["A1"]);
ShapeHyperlink shapeHyperlink = picture.InsertHyperlink("https://community.devexpress.com/blogs/", true);
shapeHyperlink.TooltipText = "Check the recent DevExpress blogs";
Dim workbook As Workbook = New Workbook()
Dim picture As Picture = workbook.Worksheets(0).Pictures.AddPicture("DevExpress.png", workbook.Worksheets(0).Cells("A1"))
Dim shapeHyperlink As ShapeHyperlink = picture.InsertHyperlink("https://community.devexpress.com/blogs/", True)
shapeHyperlink.TooltipText = "Check the recent DevExpress blogs"