Hi,
This is a bitmap rotation test.
My rotation algorithm isn't hardware and for this reason not fast enough.
Is there anyone who knows a faster algorithm?
Uses "ui","math"
#INCLUDE "abc.inc"
DWord hdc, hwnd
hwnd = Canvas_Window("ROTATE",xMiddle(400),yMiddle(240),400,240)
Canvas_Attach(hwnd,0,%TRUE)
hdc = Canvas_GetDC()
SetHandleDC hdc
SetFont 18,18,%FW_BOLD,""
Dim av(6) As Single
Dim aw(6) As Single
Long b2, x, y
For x=1 To 6
av(x) = Rand(6,10)
aw(x) = av(x)
Next
b2 = LoadBmp "img/angel.bmp",1
While IsWindow(hwnd) And KeyDown(27)=0
Canvas_Clear 0
For x=1 To 6
RotBitmap b2,x*64-64,y*64+60,av(x)
RotBitmap b2,x*64-64,y*64+130,-av(x)
Next
For x=1 To 6
av(x) += aw(x)
If av(x) >=360 Then av(x)= aw(x)
Next
DrawText 60,20,"BITMAP ROTATION",255+255*256+255*65536
Canvas_Redraw
'Sleep 10
Wend
FreeGraphic
Canvas_Window End
Bookmarks