You can reposition the image in the drawing window by changing the center point of a view using the CenterPoint property. When the center point of a view is changed and the size of the view is not changed, the view is panned parallel to the screen. For information on resizing the image in the drawing window, see Scale a View.
用户可以重新定位图形窗口中的图像,只需要使用 CenterPoint 属性修改视图的中心点。当视图的中心点被修改而视图的大小没有修改时,视图将在屏幕上进行平移。关于在图形窗口中调整图像的大小,请参见 缩放视图部分。
This example code demonstrates how to change the center point of the current view using the Zoom procedure defined under Manipulate the Current View.
本例代码演示如何使用 操作当前视图部分定义的 Zoom 过程修改当前视图的的中心点。
While the Zoom procedure is passed a total of four values, the first two values are defined as new 3D points and are ignored by the procedure. The third value is the point (5,5,0) to define the new center point of the view and 1 is passed in for the last value to retain the size of the current view.
虽然 Zoom 过程总共需要传递四个参数,然而第一二个参数使用新建的 3D 点并被这个过程忽略掉。第三个值是点(5,5,0),它是视图的新中心点,1 被传递给最后一个值,以保留当前视图原有大小。
<CommandMethod("ZoomCenter")> _
Public Sub ZoomCenter()
'' 视图的中心定位在(5,5,0) Center the view at 5,5,0
Zoom(New Point3d(), New Point3d(), New Point3d(5, 5, 0), 1)
End Sub
[CommandMethod("ZoomCenter")]
static public void ZoomCenter()
{
// 视图的中心定位在(5,5,0) Center the view at 5,5,0
Zoom(new Point3d(), new Point3d(), new Point3d(5, 5, 0), 1);
}