GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / PageHeight Property
Example





In This Topic
PageHeight Property (GdViewer)
In This Topic
Returns the height, in pixels, of the current page of the document displayed in the GdViewer control.
Syntax
'Declaration
 
Public ReadOnly Property PageHeight As Integer
public int PageHeight {get;}
public read-only property PageHeight: Integer; 
public function get PageHeight : int
public: __property int get_PageHeight();
public:
property int PageHeight {
   int get();
}

Property Value

The current page height, in pixels.
Example
How to determine the area of the point clicked by the mouse.
'We assume that the GdViewer1 control has been properly integrated.
Sub GdViewer1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs)
    Dim message As String = "This point is inside the document area."
    Dim ViewerLeft As Integer = e.X, ViewerTop As Integer = e.Y
    Dim DocumentLeft As Integer = 0, DocumentTop As Integer = 0
    GdViewer1.CoordViewerToDocument(ViewerLeft, ViewerTop, DocumentLeft, DocumentTop)
    If DocumentLeft < 0 OrElse DocumentTop < 0 OrElse DocumentLeft >= GdViewer1.PageWidth OrElse DocumentTop >= GdViewer1.PageHeight Then
        message = "This point is outside the document area."
    End If
    MessageBox.Show(message, "GdViewer.PageHeight")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void GdViewer1_MouseClick(object sender, MouseEventArgs e)
{
    string message = "This point is inside the document area.";
    int ViewerLeft = e.X, ViewerTop = e.Y;
    int DocumentLeft = 0, DocumentTop = 0;
    GdViewer1.CoordViewerToDocument(ViewerLeft, ViewerTop, ref DocumentLeft, ref DocumentTop);
    if (DocumentLeft < 0 || DocumentTop < 0 || DocumentLeft >= GdViewer1.PageWidth || DocumentTop >= GdViewer1.PageHeight)
    {
        message = "This point is outside the document area.";
    }
    MessageBox.Show(message, "GdViewer.PageHeight");
}
See Also