hehe ok I got it !
I have 2 advices:
1/ Get rid of the timer !! It's an horrible component which can't go under 20 ms of accuracy.
Instead I strongly suggest you to use the Application.onIdle event.
To show you a bit the difference, look at this new version : http://momorproductions.free.fr/temp...otate_idle.zip
2/ I think the rotation could be boosted by a complete change of the algorithm (sorry ).
Your current algorithm is the following:
- Compute the destination bounding box size (Rwi, Rht)
- For each pixel of the bounding box:
- Reverse compute the original pixel in the original bitmap
- if not out of the bitmap, draw the pixel to the destination bitmap, otherwise draw transparent
Here is the algorithm I suggest:
- Compute the A,B,C,D coordinates of the destination polygon
- For each scanline of the destination polygon:
- Compute onScreen XStart and XEnd coordinates
- Compute the corresponding (XOriginalStart, YOriginalStart) and (XOriginalEnd, YOriginalEnd) coordinates in the original bitmap
- Make a linear interpolation from Start to End to fill the scanline
This latest algorithm as a new benefit : it allows a generic deformation (zoom, rotation, stretch ...)
I hope this helps !!!
Bookmarks