Clip Command

Purpose

Sets the bounds for graphic output.

Syntax

Clip x, y, w, h

Clip x1,y1 To x2,y2

Clip Off

x, y, w, h, x1,y1, x2,y2: floating point expression

Description

Clip x, y, w, h limits the graphic output to a defined rectangle.

Clip x1,y1 To x2,y2 defines the upper left corner of the clipping rectangle with x1 and y1, and the lower right corner with x2 and y2.

Clip Off turns the clipping off.

Clipping applies to the AutoRedraw bitmap as well. Clipping affects output in the Paint event, so that in case of an AutoRedraw the memory device context bitmap is copied for the clipping only. Make sure the clipping is off in this case.

Example

OpenW # 1 : Win_1.AutoRedraw = 1

PCircle 80, 80, 70  // Draws a full black circle

Clip 10, 10, 70, 70

// limits the graphic output to a window with the following coordinates:

// 10,10 upper left

// 80,10 upper right

// 10,80 lower left

// 80,80 lower right

Color 255

PCircle 80, 80, 70  // Draws a red top left quadrant

Clip Off // turns the clipping off.

Remarks

The clipping does not apply to the Get and Put commands.

In contrast to GFA-BASIC for Windows (16 Bit) version the OffSet of the Clip function is gone. In the GFA-BASIC 32 the offset in set using ScaleLeft and ScaleTop.

See Also

OffsetXY, Scale, ScaleLeft, ScaleTop

{Created by Sjouke Hamstra; Last updated: 02/03/2022 by James Gaite}