GetVisibleRect Method
Returns the coordinates of the document rectangle currently visible in the viewer control.
expression.GetVisibleRect(Left, Top, Right, Bottom)
*expression * Required. An expression that returns an MiDocView object.
*Left * Required Long. Returns the distance in pixels from the left edge of the containing image to the left edge of the rectangle .
*Top * Required Long. Returns the distance in pixels from the top edge of the containing image to the top edge of the rectangle.
*Right * Required Long. Returns the distance in pixels from the left edge of the containing image to the right edge of the rectangle.
*Bottom * Required Long. Returns the distance in pixels from the top edge of the containing image to the bottom edge of the rectangle .
Remarks
All of the rectangle objects and properties in the Microsoft Office Document Imaging 2003 object model work as follows:
- The Top and Bottom properties represent the distance in pixels from the top edge of the containing image.
- The Left and Right properties represent the distance in pixels from the left edge of the containing image.
Example
The following example displays the coordinates of the document rectangle that is visible in the viewer control.
Sub TestGetVisibleRect()
Dim lngLeft As Long, lngTop As Long
Dim lngRight As Long, lngBottom As Long
Dim strRectInfo As String
MiDocView1.GetVisibleRect lngLeft, lngTop, lngRight, lngBottom
strRectInfo = _
lngLeft & ", " & lngTop & ", " & _
lngRight & ", " & lngBottom
MsgBox strRectInfo, vbInformation + vbOKOnly, _
"Visible Rectangle Info"
End Sub
Applies to | MiDocView Object