Most of the delay is probably going into drawing the individual points. A simple thing you can do to improve drawing efficiency is to use the batch drawing feature of the canvas (check out the CanvasStartBatchDraw function). It greatly reduces the overhead of each individual call to a drawing function.
If you can't use batch drawing (if, for example, you need to other types of drawing to your panel interspersed with drawing your canvas image) then you should look at the ATTR_DRAW_POLICY attribute of the canvas, and see which trade-offs might be beneficial to you.
A better approach, however, especially if your image data is nice and compact, might be to draw your pixels via a bitmap. This would also have the benefit of improving the efficiency of obtaining the o
riginal data. Instead of using CanvasGetPixels/CanvasDrawPoint, this is what you can do:
GetCtrlBitmap...
GetBitmapInfo...
GetBitmapData...
(modify the data _in memory_ while applying your rotation algorithm)
SetBitmapData...
CanvasDrawBitmap...
DiscardBitmap...
If the bounding rect of the data would change after the rotation, then you can't use SetBitmapData. Instead you should use NewBitmap and pass it the modified data array. In that case, you might also need to clear the area of the original image in that canvas.
The only thing to look out for is that, when you modify the bitmap data, most likely you'll be dealing with multiple bytes per pixel. This shouldn't be very difficult, though. Just copy the (R,G,B) values as a whole, and be careful when calculating your pixel offsets. There will also be some padding at the end of each row of pixels.
Luis Gomes
NI