设定view窗口的大小及位置

本帖最后由 jack7 于 2010-3-2 16:29 编辑

请教 迷大师 mdl函数写成的『设定view窗口的大小及位置』函数,请大家测试指导!
默认.jpg

'声明
Declare Function mdlWindow_viewWindowGet Lib "stdmdlbltin.dll" (ByVal viewNum As Long) As Long
Declare Sub mdlWindow_extentSet Lib "stdmdlbltin.dll" (ByVal windowP As Long, ByVal width As Long, ByVal height As Long)
Declare Function mdlWindow_resize Lib "stdmdlbltin.dll" (ByVal windowP As Long, ByVal cornerNum As Long, ByRef newPositionP As LPoint2d) As Long
'///////////////////////////////////

Function SetViewSP(x, y, w, h, v) '设定view窗口的大小及位置
Dim SUCCESS As Long, lp As LPoint2d
lp.x = x: lp.y = y
Call mdlWindow_extentSet(mdlWindow_viewWindowGet(v - 1), w, h)
SUCCESS = mdlWindow_resize(mdlWindow_viewWindowGet(v - 1), 4, lp)
End Function

Sub Main() '入口
SetViewSP 100, 100, 500, 400, 1 '--->
End Sub
2.jpg
已邀请:

MicroStation迷

赞同来自:

帅呆了!需要增加一个LPoint2d的定义如下:
Type LPoint2d
X as Long
Y as Long
End Type

jack7

赞同来自:

还是 迷大师 精准!谢谢!

zfybs - 交通专业

赞同来自:

学习了。

要回复问题请先登录注册