ImageEn, unit iexUserInteractions |
|
TIEPdfViewerInteraction.PageOrigin
Declaration
function PageOrigin(Idx: Integer): TPoint;
Description
Returns the origin of the specified page in the virtual image of all pages vertically stacked (when
ShowAllPages is enabled).
Notes:
- X value will always be zero
- If
ShowAllPages = False, result will be (0, 0)
-
PageOrigin is returned as bitmap dimensions, i.e. it is NOT affected by
ZoomExample
// Show page 5
ImageEnView1.ViewY := Round( ImageEnView1.PdfViewer.PageOrigin(4).Y * ImageEnView1.ZoomY / 100 )
// Scroll to clicked position in current page
yPos := ImageEnView1.YScrToBmp( y );
yOff := 0;
if ImageEnView1.PdfViewer.Enabled then
yOff := ImageEnView1.PdfViewer.PageOrigin( ImageEnView1.PdfViewer().PageIndex ).Y;
ImageEnView1.ViewY := Round( (yOff + yPos) * ImageEnView1.ZoomY / 100 )
// Scroll 25% way down current page
scrPos := ImageEnView1.PdfViewer.PageHeight div 4;
yOff := 0;
if ImageEnView1.PdfViewer.Enabled then
yOff := ImageEnView1.PdfViewer.PageOrigin( ImageEnView1.PdfViewer().PageIndex ).Y;
ImageEnView1.ViewY := Round( (yOff + scrPos) * ImageEnView1.ZoomY / 100 )
See Also
-
PageWidth-
PageHeight