Xbasic

SET_ROTATE Function

Syntax

V SET_ROTATE(N degrees)

Arguments

degrees

A number between 0 and 360.

Description

Set rotation of coordinates in degrees.

Discussion

The SET_ROTATE() function rotates the coordinate system around the origin, which by default is in the upper left corner of the bitmap. The SET_ORIGIN()function can change the location of the origin.

Example

The following example sets the origin in the center of this bitmap, draws a triangle, rotates the coordinate system by 30 degrees, then draws a second triangle.

images/GR_SET_ROTATE.gif
ui_bitmap_create("test", 4, 2)
ui_bitmap_draw("test",<<%code%
inner_Rect(0, 0, 4, 2)
set_pen("black", "Solid", 1)
set_origin(2, 1)
set_brush("green")
start_poly(0, -.75)
lineto(1, .25)
lineto(-1, .25)
fill_poly(0, -.75)
set_rotate(30)
set_brush("blue")
start_poly(0, -.75)
lineto(1, .25)
lineto(-1, .25)
fill_poly(0, -.75)
%code%)
ui_dlg_box("","{image=test}")

Limitations

Used only in the Code sections of UI_BITMAP_DRAW(), UI_SCREEN_DRAW(), and UI_PRINTER_DRAW().

See Also