Skip to main content
A newer version of this page is available. .

XlPictureHyperlink Class

Represents a hyperlink associated with a picture.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v20.2.Core.dll

NuGet Packages: DevExpress.Printing.Core, DevExpress.WindowsDesktop.Printing.Core

Declaration

The following members return XlPictureHyperlink objects:

Remarks

An XlPictureHyperlink object for a particular IXlPicture is accessible by using the IXlPicture.HyperlinkClick property.

The following example illustrates how to add a hyperlink to a picture.

// Create an exporter instance.
IXlExporter exporter = XlExport.CreateExporter(documentFormat);

// Create a new document.
using (IXlDocument document = exporter.CreateDocument(stream))
{
    document.Options.Culture = CultureInfo.CurrentCulture;

    // Create a worksheet.
    using (IXlSheet sheet = document.CreateSheet())
    {

        // Load a picture from a file and add a hyperlink to it.
        using (IXlPicture picture = sheet.CreatePicture())
        {
            picture.Image = Image.FromFile(Path.Combine(imagesPath, "DevExpress.png"));
            picture.HyperlinkClick.TargetUri = "https://www.devexpress.com/";
            picture.HyperlinkClick.Tooltip = "Developer Express Inc.";
            picture.SetTwoCellAnchor(new XlAnchorPoint(1, 1, 0, 0), new XlAnchorPoint(10, 5, 2, 15), XlAnchorType.TwoCell);
        }
    }
}

Inheritance

Object
XlHyperlinkBase
XlPictureHyperlink
See Also