Can you rotate bitmaps?
Or can you draw images at angles?
Ta ;-)
One of the watch face examples demonstrates rotations to draw the watch hands.
var centerX = dc.getWidth() / 2;
var centerY = dc.getHeight() / 2;
var cos = Math.cos(angle);
var sin = Math.sin(angle);
// Transform the coordinates
for (var i = 0; i < 4; i += 1)
{
var x = (coords[0] * cos) - (coords[1] * sin);
var y = (coords[0] * sin) + (coords[1] * cos);
result= [ centerX+x, centerY+y];
}
// Draw the polygon
dc.fillPolygon(result);
[/code]
Using an affine transformation matrix does not eliminate the need to use sin/cos, nor does it do anything to reduce the number of times they are called. It is just another way of representing the same calculation.