RubberBox Command

Purpose

Cuts out a rectangular segment of the screen.

Syntax

RubberBox x, y, minw, minh, varw, varh

x, y, minw, minhSingle exp
varw, varh:Single variables

Description

RubberBox can only be used by pressing the left mouse button.

Given are the coordinates of the upper left corner as well as the minimal width and height. By moving the mouse the size of the rectangle can be changed (rubber band effect) as long as the left mouse button is held down. When the mouse button is released the width and height are returned.

By specifying the negative width and height the rectangle can be drawn in the upper left direction.

Example

OpenW 1

Local Single a, b, x, y

Local k%

DefFill 4

Scale 0, 0, .5, .5

Do

DoEvents

Repeat

Mouse x, y, k%

Until k%

Exit Do If k% = 2

RubberBox x, y, 0, 0, a, b

Color Rand(_C), Rand(_C)

PBox x, y, x + a, y + b

Loop

CloseW # 1

This program enables drawing of rectangles in different colors with the mouse.

See Also

DragBox

{Created by Sjouke Hamstra; Last updated: 22/10/2014 by James Gaite}