#module
#deffunc grotate int, int, int, int, int, int
mref id, 0 : mref bx, 1 : mref by, 2 : mref sx, 3 : mref sy, 4 : mref direction, 5
mref bmscr, 67
act = bmscr.18 // コピー先(アクティブ)ウィンドウを保持
bcol = bmscr.40 & 0xFF, bmscr.40 >> 8 & 0xFF, bmscr.40 >> 16 & 0xFF
cx = csrx : cy = csry
repeat sx * sy
gsel id
pget cnt \ sx, cnt / sx
col = rval, gval, bval
gsel act
color col.0, col.1, col.2
if direction = 0 : pset cx + (cnt \ sx), cy + (cnt / sx)
if direction = 1 : pset cx + sy - (cnt / sx) - 1, cy + (cnt \ sx)
if direction = 2 : pset cx + sx - (cnt \ sx) - 1, cy + sy - (cnt / sx) - 1
if direction = 3 : pset cx + (cnt / sx), cy + sx - (cnt \ sx) - 1
loop
pos cx, cy // カレントポジションを戻す
color bcol.0, bcol.1, bcol.2
return
#global
buffer 2
picload "sample/ssaver/Aruface.bmp"
gsel 0
redraw 0
pos 150, 50 : mes "0度"
pos 150, 80 : grotate 2, , , 80, 80, 0
pos 350, 50 : mes "90度"
pos 350, 80 : grotate 2, , , 80, 80, 1
pos 150, 300 : mes "180度"
pos 150, 330 : grotate 2, , , 80, 80, 2
pos 350, 300 : mes "270度"
pos 350, 330 : grotate 2, , , 80, 80, 3
redraw 1
stop
|