Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Graphics > interaction > rubberbox

rubberbox

矩形選択用の輪ゴムボックス

呼び出し手順

[final_rect,btn]=rubberbox()

[final_rect,btn]=rubberbox(initial_rect)

[final_rect,btn]=rubberbox(edition_mode)

[final_rect,btn]=rubberbox(initial_rect, edition_mode)

Pパラメータ

initial_rect

2個または4個のエントリを有するベクトル.4個のエントリを有する場合, [x_min, y_max, width, height]で定義される初期矩形を指定し, 2個のエントリを有する場合, 幅と高さは0と仮定されます.

edition_mode

論理値, edition_mode が%tの場合, ボタンを押すと最初の角が選択され,開放すると反対の角が選択されます. edition_mode が%fの場合, ボタンを押すか クリックすると最初の角,クリックすると反対の角が選択されます. デフォルトは %f です.

final_rect

[x_min, y_max, width, height]で定義された矩形

btn

整数, マウスボタンがクリックされた回数

説明

rubberbox(initial_rect) はマウスに基づき カレントのグラフィックウインドウ内で輪ゴムボックスを 追跡します. ボタンがクリックされると, rubberboxfinal_Rectで定義された最後の矩形を返します 引数initial_rectが指定されない場合, 最初の角の位置を固定するためのクリックが必要です.

clf

plot2d()

a = gca();

db = a.data_bounds;

x0 = (db(1)*2+db(2))/3;

dx = (db(2)-db(1))/3;

y0 = (db(3)+db(4)*2)/3;

dy = (db(4)-db(3))/3;

xtitle(msprintf("With an initial starting corner: x0 = %0.2f, y0 = %0.2f",x0,y0))

r = rubberbox([x0 y0])
clf

plot2d()

a = gca();

db = a.data_bounds;

x0 = (db(1)*2+db(2))/3;

dx = (db(2)-db(1))/3;

y0 = (db(3)+db(4)*2)/3;

dy = (db(4)-db(3))/3;

xtitle(msprintf("With an initial box: x0 = %0.2f, y0 = %0.2f, width = %0.2f, hight = %0.2f,",x0-dx/4,y0+dy/5,2*dx,dy))

r = rubberbox([x0-dx/4 y0+dy/5 2*dx dy])
clf

plot2d()

a = gca();

db = a.data_bounds;

x0 = (db(1)*2+db(2))/3;

dx = (db(2)-db(1))/3;

y0 = (db(3)+db(4)*2)/3;

dy = (db(4)-db(3))/3;

xtitle("In press -- drag -- release mode selection:")

r = rubberbox(%t)
clf

plot2d()

a = gca();

db = a.data_bounds;

x0 = (db(1)*2+db(2))/3;

dx = (db(2)-db(1))/3;

y0 = (db(3)+db(4)*2)/3;

dy = (db(4)-db(3))/3;

xtitle("In starting click -- drag -- stopping click mode selection:")

r = rubberbox()

参照

  • xrect — 矩形を描画する
  • xrects — 一連の矩形を描画または塗りつぶす
  • xclick — マウスクリップを待つ.
  • xgetmouse — マウスのイベントおよびカレントの位置を取得する
  • dragrect — マウスで矩形をドラッグ
Report an issue
<< locate interaction seteventhandler >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:53:22 CET 2020