In This Topic
Returns coordinates and dimensions, in pixels, of the viewer area, which is covered by the current page of the document displayed in the GdViewer control.
Be aware that the resulting coordinate may be negative if the currently displayed page is shifted outside the viewer area.
Syntax
'Declaration
Public Sub GetPageBounds( _
ByRef As Double, _
ByRef As Double, _
ByRef As Double, _
ByRef As Double _
)
public void GetPageBounds(
ref double ,
ref double ,
ref double ,
ref double
)
public procedure GetPageBounds(
var : Double;
var : Double;
var : Double;
var : Double
);
public function GetPageBounds(
: double,
: double,
: double,
: double
);
public: void GetPageBounds(
ref double ,
ref double ,
ref double ,
ref double
)
public:
void GetPageBounds(
double% ,
double% ,
double% ,
double%
)
Parameters
- Left
- Output parameter. The horizontal (X) coordinate (0-based) of the top left point, in pixels, within the viewer area,
where the top left point of the displayed page is located.
- Top
- Output parameter. The vertical (Y) coordinate (0-based) of the top left point, in pixels, within the viewer area,
where the top left point of the displayed page is located.
- Width
- Output parameter. The width, in pixels, of the viewer area, which is covered by the currently displayed page.
- Height
- Output parameter. The height, in pixels, of the viewer area, which is covered by the currently displayed page.
Example
How to find out the viewer area covered with the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
Dim l1 As Double = 0, t1 As Double = 0, w1 As Double = 0, h1 As Double = 0
GdViewer1.GetDisplayedArea(l1, t1, w1, h1)
Dim l2 As Double = 0, t2 As Double = 0, w2 As Double = 0, h2 As Double = 0
GdViewer1.GetPageBounds(l2, t2, w2, h2)
MessageBox.Show("Displayed area: X , Y = " + l1.ToString("N2") + " , " + t1.ToString("N2") + " w=" + w1.ToString("N2") + " h=" + h1.ToString("N2") + vbCrLf +
"Page bounds: X , Y = " + l2.ToString("N2") + " , " + t2.ToString("N2") + " w=" + w2.ToString("N2") + " h=" + h2.ToString("N2"), "GdViewer1.GetPageBounds")
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
double l1 = 0, t1= 0, w1 = 0, h1 = 0;
GdViewer1.GetDisplayedArea(ref l1, ref t1, ref w1, ref h1);
double l2 = 0, t2 = 0, w2 = 0, h2 = 0;
GdViewer1.GetPageBounds(ref l2, ref t2, ref w2, ref h2);
MessageBox.Show("Displayed area: X , Y = " + l1.ToString("N2") + " , " + t1.ToString("N2") + " w=" + w1.ToString("N2") + " h=" + h1.ToString("N2") +
"\nPage bounds: X , Y = " + l2.ToString("N2") + " , " + t2.ToString("N2") + " w=" + w2.ToString("N2") + " h=" + h2.ToString("N2"), "GdViewer1.GetPageBounds");
Example
How to find out the viewer area covered with the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
Dim l1 As Double = 0, t1 As Double = 0, w1 As Double = 0, h1 As Double = 0
GdViewer1.GetDisplayedArea(l1, t1, w1, h1)
Dim l2 As Double = 0, t2 As Double = 0, w2 As Double = 0, h2 As Double = 0
GdViewer1.GetPageBounds(l2, t2, w2, h2)
MessageBox.Show("Displayed area: X , Y = " + l1.ToString("N2") + " , " + t1.ToString("N2") + " w=" + w1.ToString("N2") + " h=" + h1.ToString("N2") + vbCrLf +
"Page bounds: X , Y = " + l2.ToString("N2") + " , " + t2.ToString("N2") + " w=" + w2.ToString("N2") + " h=" + h2.ToString("N2"), "GdViewer1.GetPageBounds")
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
double l1 = 0, t1= 0, w1 = 0, h1 = 0;
GdViewer1.GetDisplayedArea(ref l1, ref t1, ref w1, ref h1);
double l2 = 0, t2 = 0, w2 = 0, h2 = 0;
GdViewer1.GetPageBounds(ref l2, ref t2, ref w2, ref h2);
MessageBox.Show("Displayed area: X , Y = " + l1.ToString("N2") + " , " + t1.ToString("N2") + " w=" + w1.ToString("N2") + " h=" + h1.ToString("N2") +
"\nPage bounds: X , Y = " + l2.ToString("N2") + " , " + t2.ToString("N2") + " w=" + w2.ToString("N2") + " h=" + h2.ToString("N2"), "GdViewer1.GetPageBounds");
See Also