GetDisplayedAreaInch Method
In This Topic
Returns coordinates and dimensions, in inches, of the document's visible area within the control. The resulting rectangle relates to the current page
of the document displayed in the GdViewer control and the coordinates correspond to the actual document pages area of the currently displayed page.
Syntax
'Declaration
Public Sub GetDisplayedAreaInch( _
ByRef As Double, _
ByRef As Double, _
ByRef As Double, _
ByRef As Double _
)
public void GetDisplayedAreaInch(
ref double ,
ref double ,
ref double ,
ref double
)
public procedure GetDisplayedAreaInch(
var : Double;
var : Double;
var : Double;
var : Double
);
public function GetDisplayedAreaInch(
: double,
: double,
: double,
: double
);
public: void GetDisplayedAreaInch(
ref double ,
ref double ,
ref double ,
ref double
)
public:
void GetDisplayedAreaInch(
double% ,
double% ,
double% ,
double%
)
Parameters
- Left
- Output parameter. The horizontal (X) coordinate (0-based) of the top left point, in inches, of the document's area visible in the control.
- Top
- Output parameter. The vertical (Y) coordinate (0-based) of the top left point, in inches, of the document's area visible in the control.
- Width
- Output parameter. The width, in inches, of the visible area rectangle.
- Height
- Output parameter. The height, in inches, of the visible area rectangle.
Example
How to determine the fully visible rectangle of the current page within the viewer.
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
Dim left As Double = 0, top As Double = 0, width As Double = 0, height As Double = 0
GdViewer1.GetDisplayedAreaInch(left, top, width, height)
MessageBox.Show("Page width (X): " + (GdViewer1.PageInchWidth).ToString() + vbCrLf + "Page height (Y): " + (GdViewer1.PageInchHeight).ToString() + vbCrLf + vbCrLf +
"Displayed area:" + vbCrLf + " top-left point (X,Y): " + left + ", " + top + vbCrLf + " width: " + width + " height: " + height, "GdViewer.GetDisplayedAreaInch")
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
double left = 0, top = 0, width = 0, height = 0;
GdViewer1.GetDisplayedAreaInch(ref left, ref top, ref width, ref height);
MessageBox.Show("Page width (X): " + (GdViewer1.PageInchWidth).ToString() + "\nPage height (Y): " + (GdViewer1.PageInchHeight).ToString() + "\n\n" +
"Displayed area:\n top-left point (X,Y): " + left + ", " + top + "\n width: " + width + " height: " + height, "GdViewer.GetDisplayedAreaInch");
Example
How to determine the fully visible rectangle of the current page within the viewer.
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
Dim left As Double = 0, top As Double = 0, width As Double = 0, height As Double = 0
GdViewer1.GetDisplayedAreaInch(left, top, width, height)
MessageBox.Show("Page width (X): " + (GdViewer1.PageInchWidth).ToString() + vbCrLf + "Page height (Y): " + (GdViewer1.PageInchHeight).ToString() + vbCrLf + vbCrLf +
"Displayed area:" + vbCrLf + " top-left point (X,Y): " + left + ", " + top + vbCrLf + " width: " + width + " height: " + height, "GdViewer.GetDisplayedAreaInch")
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
double left = 0, top = 0, width = 0, height = 0;
GdViewer1.GetDisplayedAreaInch(ref left, ref top, ref width, ref height);
MessageBox.Show("Page width (X): " + (GdViewer1.PageInchWidth).ToString() + "\nPage height (Y): " + (GdViewer1.PageInchHeight).ToString() + "\n\n" +
"Displayed area:\n top-left point (X,Y): " + left + ", " + top + "\n width: " + width + " height: " + height, "GdViewer.GetDisplayedAreaInch");
See Also