Reference Guide
GdPicture14.WPF Namespace / GdViewer Class / PageVerticalResolution Property
Example





In This Topic
    PageVerticalResolution Property
    In This Topic
    Gets the vertical resolution in DPI (dots per inch) of the current page of the document displayed in the GdViewer control.
    Syntax
    'Declaration
     
    
    Public ReadOnly Property PageVerticalResolution As Double
    public double PageVerticalResolution {get;}
    public read-only property PageVerticalResolution: Double; 
    public function get PageVerticalResolution : double
    public: __property double get_PageVerticalResolution();
    public:
    property double PageVerticalResolution {
       double get();
    }

    Property Value

    The current page vertical resolution, in DPI.
    Remarks
    Please note that the resulting value also depends on the currently set zoom factor.
    Example
    How to determine the area of the point clicked by the mouse.
    Private Sub GdViewer1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs)
        'We assume that the GdViewer1 control has been properly integrated.
        Dim message As String = "This point is inside the document area."
        Dim ViewerLeft As Double = e.GetPosition(Me).X, ViewerTop As Double = e.GetPosition(Me).Y
        Dim DocumentLeft As Double = 0, DocumentTop As Double = 0
        GdViewer1.CoordViewerPixelToDocumentInch(ViewerLeft, ViewerTop, DocumentLeft, DocumentTop)
        Dim widthInches As Double = GdViewer1.PageInchWidth / GdViewer1.PageHorizontalResolution
        Dim heightInches As Double = GdViewer1.PageInchHeight / GdViewer1.PageVerticalResolution
        If DocumentLeft < 0 OrElse DocumentTop < 0 OrElse DocumentLeft >= widthInches OrElse DocumentTop >= heightInches Then
            message = "This point is outside the document area."
        End If
        MessageBox.Show(message, "GdViewer.PageVerticalResolution")
    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.";
        double ViewerLeft = e.GetPosition(this).X, ViewerTop = e.GetPosition(this).Y;
        double DocumentLeft = 0, DocumentTop = 0;
        GdViewer1.CoordViewerPixelToDocumentInch(ViewerLeft, ViewerTop, ref DocumentLeft, ref DocumentTop);
        double widthInches = GdViewer1.PageInchWidth / GdViewer1.PageHorizontalResolution;
        double heightInches = GdViewer1.PageInchHeight / GdViewer1.PageVerticalResolution;
        if (DocumentLeft < 0 || DocumentTop < 0 || DocumentLeft >= widthInches || DocumentTop >= heightInches)
        {
            message = "This point is outside the document area.";
        }
        MessageBox.Show(message, "GdViewer.PageVerticalResolution");
    }
    See Also