PeachDrawing.Core

PeachDrawing.Core.Canvas

Canvas.AddLink(Rect, string, IReadOnlyList<PaintPoint>) Method

Makes bounds a clickable link to uri (a web address, or any other URI) on the page this canvas draws. A canvas for a format with hyperlinks (PDF, SVG) writes one; the default writes nothing, which is right for a canvas of pixels. Call it once the content the link covers has been drawn: where the link sits in the output is up to the format, but it is meant to lie over what is already there.

public virtual object? AddLink(PeachDrawing.Core.Rect bounds, string uri, System.Collections.Generic.IReadOnlyList<PeachDrawing.Core.PaintPoint>? quad=null);

Parameters

bounds Rect

the clickable area, in this canvas’s layout units like every other rectangle

uri System.String

where the link leads

quad System.Collections.Generic.IReadOnlyList<PaintPoint>

the four corners of the clickable shape (top-left, top-right, bottom-left, bottom-right of the rectangle it started as), in the same units, when it is not bounds itself - a link over a rotated element - or null

Returns

System.Object
a handle the canvas’s own format defines for the link it wrote (the PDF canvas returns the link a tagged document attaches to a structure element), or null when nothing was written or the format has nothing to hand back