Gets or sets a string which represents the hyperlink for this AnnObject.
public string Hyperlink {get; set;}
Public Property Hyperlink As String
public string Hyperlink {get; set;}
@property (nonatomic,copy) NSString* hyperlink;
public String getHyperlink()
public void setHyperlink(String hyperlink)
get_Hyperlink();
set_Hyperlink(value);
Object.defineProperty('Hyperlink');
The hyperlink for this AnnObject. The default value is null.
The hyperlink of an object can be any string value or null. It is up to the user's application to determine how to use this value.
This example will create two annotation objects with hyperlinks and add them to a container, switches to run mode and run the hyperlink when the object is clicked.
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;
using Leadtools.Annotations.WinForms;
public void AnnObject_Hyperlink()
{
double inch = 720.0;
// Get the container
AnnContainer container = _automation.Container;
// Add a red on green rectangle from 1in 1in to 2in 2in
AnnRectangleObject rectObj = new AnnRectangleObject();
rectObj.Rect = LeadRectD.Create(1 * inch, 1 * inch, 1 * inch, 1 * inch);
rectObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Red"), LeadLengthD.Create(1));
rectObj.Fill = AnnSolidColorBrush.Create("Green");
// Set its hyperlink
rectObj.Hyperlink = "https://www.leadtools.com";
// Add it to the container
container.Children.Add(rectObj);
// Add a blue on yellow rectangle from 3in 3in to 4in 4in
rectObj = new AnnRectangleObject();
rectObj.Rect = LeadRectD.Create(3 * inch, 3 * inch, 1 * inch, 1 * inch);
rectObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthD.Create(1));
rectObj.Fill = AnnSolidColorBrush.Create("Yellow");
rectObj.Hyperlink = "https://www.leadtools.com/downloads/demos.htm";
// Add it to the container
container.Children.Add(rectObj);
// Subscribe to the Run event of the automation
_automation.Run += _automation_Run;
// Switch to run mode
_automation.Manager.UserMode = AnnUserMode.Run;
Debug.WriteLine("Run mode, click on the rectangles to go to their hyperlinks");
}
void _automation_Run(object sender, AnnRunDesignerEventArgs e)
{
// Check for status == End
if (e.OperationStatus == AnnDesignerOperationStatus.End)
{
// Get the annotation object
AnnObject annObj = e.Object;
// Get its hyperlink string
string hyperlink = annObj.Hyperlink;
// Browse to it
if (!String.IsNullOrEmpty(hyperlink))
{
Process.Start(hyperlink);
}
}
}
using Leadtools.Converters;
using Leadtools.Annotations.Automation;
using Leadtools.Controls;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;
public void AnnObject_Hyperlink()
{
double inch = 720.0;
// Get the container
AnnContainer container = _automation.Container;
// Add a red on green rectangle from 1in 1in to 2in 2in
AnnRectangleObject rectObj = new AnnRectangleObject();
rectObj.Rect = LeadRectDHelper.Create(1 * inch, 1 * inch, 1 * inch, 1 * inch);
rectObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Red"), LeadLengthDHelper.Create(1));
rectObj.Fill = AnnSolidColorBrush.Create("Green");
// Set its hyperlink
rectObj.Hyperlink = "https://www.leadtools.com";
// Add it to the container
container.Children.Add(rectObj);
// Add a blue on yellow rectangle from 3in 3in to 4in 4in
rectObj = new AnnRectangleObject();
rectObj.Rect = LeadRectDHelper.Create(3 * inch, 3 * inch, 1 * inch, 1 * inch);
rectObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthDHelper.Create(1));
rectObj.Fill = AnnSolidColorBrush.Create("Yellow");
rectObj.Hyperlink = "https://www.leadtools.com/downloads/demos.htm";
// Add it to the container
container.Children.Add(rectObj);
// Subscribe to the Run event of the automation
_automation.Run += _automation_Run;
// Switch to run mode
_automation.Manager.UserMode = AnnUserMode.Run;
Debug.WriteLine("Run mode, click on the rectangles to go to their hyperlinks");
}
void _automation_Run(object sender, AnnRunDesignerEventArgs e)
{
// Check for status == End
if (e.OperationStatus == AnnDesignerOperationStatus.End)
{
// Get the annotation object
AnnObject annObj = e.Object;
// Get its hyperlink string
string hyperlink = annObj.Hyperlink;
// Browse to it
if (!String.IsNullOrEmpty(hyperlink))
{
Debug.WriteLine("Opening\n" + hyperlink);
var success = Windows.System.Launcher.LaunchUriAsync(new Uri(hyperlink));
success.Completed = delegate(IAsyncOperation<bool> asyncInfo, AsyncStatus asyncStatus)
{
Debug.WriteLine("Successfully launched hyperlink address.");
};
}
}
}
Products |
Support |
Feedback: Hyperlink Property - Leadtools.Annotations.Core |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.