HitTestIndex Class

Definition

What lies where on a page: the boxes of its shown character codes with their Unicode text in content order, the areas its images and paths paint, and its link regions, queried by point and by rectangle in page space, so a viewer maps a click or a drag to content (text selection, link activation). Built from a display list with CreateHitTestIndex(), or with a page's links by CreateHitTestIndex().

public sealed class HitTestIndex

Remarks

Viewer capability 4 (the display list is what hit-testing reads). Page space is default user space (ISO 32000-2 §8.3.2.3), the space the display list and annotation rectangles are in, before the crop box, rotation and user unit: a viewer maps a device point into it through the inverse of the transform it renders with (for the software rasterizer, RenderOptions.GetDeviceTransform). Glyph boxes follow §9.4.4 and §9.8.1 (HitTestGlyph), image and path areas §8.9.4, §8.5.3 and §8.5.4 (HitTestShape), link regions §12.5.6.5 (HitTestLink).

The items are bucketed on a uniform grid over the page when the index is built, a fixed number of arrays per page; a query by point visits one cell, so it costs the few items there, and no query allocates. Matches come in order of kind (glyphs, images, paths, links) and, within a kind, in content order: for glyphs the order they were shown, for images and paths the order they were painted (the last one painted is on top), for links the order of the page's Annots array. Glyphs and links are not cut by the clip.

Immutable once built: any number of threads may query it at once.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (5)

Methods (4)