GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / GetDisplayedAreaInches Method
Output parameter. The horizontal (X) coordinate (0-based) of the top left point, in inches, of the document's area visible in the control.
Output parameter. The vertical (Y) coordinate (0-based) of the top left point, in inches, of the document's area visible in the control.
Output parameter. The width, in inches, of the visible area rectangle.
Output parameter. The height, in inches, of the visible area rectangle.
Example





In This Topic
GetDisplayedAreaInches Method (GdViewer)
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 GetDisplayedAreaInches( _
   ByRef Left As Single, _
   ByRef Top As Single, _
   ByRef Width As Single, _
   ByRef Height As Single _
) 
public void GetDisplayedAreaInches( 
   ref float Left,
   ref float Top,
   ref float Width,
   ref float Height
)
public procedure GetDisplayedAreaInches( 
   var  Left: Single;
   var  Top: Single;
   var  Width: Single;
   var  Height: Single
); 
public function GetDisplayedAreaInches( 
   Left : float,
   Top : float,
   Width : float,
   Height : float
);
public: void GetDisplayedAreaInches( 
   ref float Left,
   ref float Top,
   ref float Width,
   ref float Height
) 
public:
void GetDisplayedAreaInches( 
   float% Left,
   float% Top,
   float% Width,
   float% Height
) 

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.
Remarks
You can regularly apply the GetStat method to determine if this method has been successful.

Just to remind you, that all coordinates are 0-based with the origin being in the top left corner in the document pages area and they are related to the current page determined by the CurrentPage property.

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 Single = 0, top As Single = 0, width As Single = 0, height As Single = 0
GdViewer1.GetDisplayedAreaInches(left, top, width, height)
MessageBox.Show("Page width (X): " + (GdViewer1.PageWidth / 96).ToString() + vbCrLf + "Page height (Y): " + (GdViewer1.PageHeight / 96).ToString() + vbCrLf + vbCrLf +
                "Displayed area:" + vbCrLf + "  top-left point (X,Y): " + left + ", " + top + vbCrLf + "  width: " + width + "  height: " + height, "GdViewer.GetDisplayedAreaInches")
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
float left = 0, top = 0, width = 0, height = 0;
GdViewer1.GetDisplayedAreaInches(ref left, ref top, ref width, ref height);
MessageBox.Show("Page width (X): " + (GdViewer1.PageWidth / 96).ToString() + "\nPage height (Y): " + (GdViewer1.PageHeight / 96).ToString() + "\n\n" +
                "Displayed area:\n  top-left point (X,Y): " + left + ", " + top + "\n  width: " + width + "  height: " + height, "GdViewer.GetDisplayedAreaInches");
See Also