Product : Engine, Version : 4.1.6.1029, ArticleID : 41023426

HowTo : Find coordinates of the visible area

Article41023426
TypeHowTo
ProductEngine
Version4.1.6.1029
Date Added2/4/2004
Submitted bySorin Nistor
Keywords

Subject

Find coordinates of the visible area

Summary

Is it possible to find out the logical coordinates of the visible area of a drawing that is displayed in the control?

Solution

Dim LowLeft As Variant
Dim UpperRight As Variant
    
    LowLeft = Array(VDPro1.ActiveDocument.OriginX - VDPro1.ActiveDocument.ViewWidth / 2, VDPro1.ActiveDocument.OriginY - VDPro1.ActiveDocument.ViewSize / 2)
    UpperRight = Array(VDPro1.ActiveDocument.OriginX + VDPro1.ActiveDocument.ViewWidth / 2, VDPro1.ActiveDocument.OriginY + VDPro1.ActiveDocument.ViewSize / 2)

OriginX is the x coordinate of the centre of the screen and OriginY is the y coordinate(DCS).
ViewWidth is the dx (in drawing units) of upper left and upper right corner of VectorDraw View Window.
ViewSize It is the dy (in drawing units) of lower and upper left corner of VectorDraw View Window.