View.Rectangle

View.Rectangle

導入

v9.0 (2011)

詳細

LongArray として、スクリーン座標内のビューの長方形を戻します。戻された配列には常に次の 4 つの項目が含まれます: 左、上、右、下の値(この順序通り)

C#構文

// get accessor

Object rtn = View.Rectangle;

1. VBScript の例

'

' This example demonstrates how to use the View.Rectangle property

'

set oView = Desktop.ActiveLayout.CreateView( "Explorer", "MyExplorer" )

oView.Move 100, 200

oView.Resize 500, 600

rect = oView.Rectangle

LogMessage( "Left = " & rect(0) )

LogMessage( "Top = " & rect(1) )

LogMessage( "Width = " & rect(2) - rect(0) )

LogMessage( "Height = " & rect(3) - rect(1) )

' Expected result:

' INFO : Left = 100

' INFO : Top = 200

' INFO : Width = 500

' INFO : Height = 600

2. JScript の例

//

// This example demonstrates how to use the View.Rectangle property

//

var oView = Desktop.ActiveLayout.CreateView( "Explorer", "MyExplorer" );

oView.Move( 100, 200 );

oView.Resize( 500, 600 );

var vba = new VBArray( oView.Rectangle );

var rect = vba.toArray();

LogMessage( "Left = " + rect[0] );

LogMessage( "Top = " + rect[1] );

LogMessage( "Width = " + (rect[2] - rect[0]) );

LogMessage( "Height = " + (rect[3] - rect[1]) );

// Expected result:

// INFO : Left = 100

// INFO : Top = 200

// INFO : Width = 500

// INFO : Height = 600

3. Python の例

#

# This example demonstrates how to use the View.Rectangle property

#

oView = Application.Desktop.ActiveLayout.CreateView( "Explorer", "MyExplorer" )

oView.Move( 100, 200 )

oView.Resize( 500, 600 )

(left, top, right, bottom) = oView.Rectangle

Application.LogMessage( "Left = " + str(left) )

Application.LogMessage( "Top = " + str(top) )

Application.LogMessage( "Width = " + str(right - left) )

Application.LogMessage( "Height = " + str(bottom - top) )

# Expected result:

# INFO : Left = 100

# INFO : Top = 200

# INFO : Width = 500

# INFO : Height = 600

関連項目

View.Move View.Resize