Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.3 - English

Change language to:
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 help >> Graphics > rubberbox

rubberbox

Rubberband box for rectangle selection

Calling Sequence

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

Arguments

initial_rect

vector with two or four entries. With four entries it gives the initial rectangle defined by [x_left, y_top, width, height], with two entries width and height are supposed to be 0.

edition_mode

a boolean, if edition_mode is %t button press selects the first corner, release selects the opposite corner. If edition_mode is %f, a button press or click selects the first corner, a click is requested to select the opposite corner. The default value is %f.

final_rect

a rectangle defined by [x_left, y_top, width, height]

btn

an integer, the number of the mouse button clicked

Description

rubberbox(initial_rect) tracks a rubberband box in the current graphic window, following the mouse. When a button is clicked rubberbox returns the final rectangles definition in final_Rect. If the argument initial_rect is not specified, a click is needed to fix the initial corner position.

Examples

xsetech(frect=[0,0,100,100])
[x,y]=xclick();r=rubberbox([x;y;30;10])
xrect(r)
r=rubberbox()

See Also

  • xrect — draw a rectangle
  • xrects — draw or fill a set of rectangles
  • xclick — Wait for a mouse click.
  • xgetmouse — get the mouse events and current position
  • dragrect — Drag rectangle(s) with mouse
<< plzr Graphics segs_properties >>

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:
Wed Oct 05 12:10:01 CEST 2011